Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Center function

Status
Not open for further replies.

DragonPrince

Programmer
Oct 1, 2008
8
IN
Is there any center function in Dreamweaver by which my web page automatically resizes depending on the resolution in the clients computer.

I set my resolution as 1024X786 but ma friend has a different resolution so de web page is kinda funny in his comp. Is it possible for me to rectify this using dreamweaver.

Thanks in Advance
 
One way is to: wrap a div around your content, make it a fixed-width and give it auto margins.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" [URL unfurl="true"]http://www.w3.org/TR/html4/loose.dtd">[/URL]
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
<title>Center Content</title>
<meta http-equiv="Content-Style-Type" content="text/css">
<style type="text/css">
body {
	margin: 50px 0; 
	padding: 0;
	text-align:center;
	}
	
#content {
	[b]width: 650px;
	margin: 0 auto;[/b]
	text-align: left;
	padding: 15px;
	border: 1px solid black;
	background-color: #ffc;
	}
</style>
</head>
<body>
<div id="content">
<h1>Center Content</h1>
<p>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Maecenas gravida. Etiam consectetuer mollis nisl. 
Donec ligula justo, facilisis id, commodo id, sollicitudin sit amet, lorem. Donec sagittis, 
odio sit amet consectetuer sollicitudin, dolor dui tincidunt erat, id viverra dolor elit vel leo. 
Nunc cursus turpis nec tortor. Sed dolor. Integer id arcu eu nisl pulvinar viverra. Nulla facilisi. 
Morbi faucibus dolor vitae erat ultricies tristique. Donec vitae nisl a enim auctor sollicitudin. 
Vestibulum mollis arcu at turpis. Aenean id mi. Vestibulum ante ipsum primis in faucibus orci luctus et 
ultrices posuere cubilia Curae; Cras quis metus quis massa blandit vulputate. Sed at lorem. Morbi ut erat. 
Nullam aliquet arcu at purus. Curabitur faucibus ante. Quisque a elit eu magna ultricies tempor. Ut vel est.
</p>
</div>
</body>
</html>

Greg
People demand freedom of speech as a compensation for the freedom of thought which they seldom use. Kierkegaard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top