Forum Moderators: not2easy

Message Too Old, No Replies

help needed for newbie

Put the Content in the Center

         

JoePaul

8:15 pm on Oct 2, 2009 (gmt 0)

10+ Year Member



I want to design a page with a green background color of 1200px and I want to center the content with white background color of size 800px. And I want to put the banner on top of the content with 900px.

Can Anybody help me with this. I dont know how to proceed.

Thanks

D_Blackwell

9:27 pm on Oct 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This should fit the bill to the initial question. Whether it fits what you actually need/want could be a separate question.

I'm inclined to wonder why the 1200px; for the one container? This could be a big question.

You said 800px; for another container, but did specify axis, so I applied to both.

I centered everything, though it is unclear if that is the intent. A banner doesn't have to be centered. Top, left is a perfectly acceptable location also.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="content-style-type" content="text/css" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
#wrapper {
background-color: green;
width: 1200px;
margin: 0 auto;
}
#banner {
width: 900px;
margin: 0 auto;
background-color: red; /*****test*/
}
#content {
background-color: #fff;
width: 800px;
height: 800px;
margin: 0 auto;
}
</style>
</head>
<body>
<div id="wrapper">
WRAPPER
<div id="banner">
BANNER
</div>
<div id="content">
CONTENT
</div>
</div>
<!--##########
I want to design a page with a green background color of 1200px and I want to center the content with white background color of size 800px. And I want to put the banner on top of the content with 900px.
-->
</body>
</html>