School Assignment? Project Due Tomorrow? Chat LIVE With A Programming Expert!
You're Browsing As A Guest! Register Now...
Become an Expert!

Join 353,816 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 3,490 people online right now.Registration is fast and FREE... Join Now!



Padding and Centering while reaching the bottom

Padding and Centering while reaching the bottom

#1 Redian  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 1
  • View blog
  • Posts: 46
  • Joined: 28-December 07


Dream Kudos: 0

Posted 17 October 2009 - 09:54 PM

The page I'm trying to create a page that looks like this.
(Sorry the image is so big!)
Posted Image
The code I'm using is fairly simple. The problem is creating that grey area for the actual content. I can get it to the right width, and the right height, but I can't get it to have the right padding on the sides that will keep the 800px width of the layout.

The HTML I have is:
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN\'>
<HTML>
<HEAD>
	<TITLE>Nameless14</TITLE>
	<link rel="stylesheet" type="text/css" href="styles/main.css"/>
</HEAD>
<BODY>
<div id="wrapper">
	<div id="LoginBox"></div>
	<div id="title"></div>
	<div id="menu">
		<ul>
			<LI>Home</LI>
			<LI class="divider"></LI>
			<LI>Struggles</LI>
			<LI class="divider"></LI>
			<LI>Accomplishments</LI>
			<LI class="divider"></LI>
			<LI>Random</LI>
			<LI class="divider"></LI>
			<LI>Help</LI>
			<LI class="divider"></LI>
		</UL>
	</div>
	<div id="content">
		Stuff
	</div>
</div>
</BODY>
</HTML>	


And the style sheet is as follows:
html, body {
	background: #303046;
	font-family: Verdana;
	margin: 0;
	height: 100%;
	width: 100%;
}
div#wrapper {
	min-height:100%; /* gives layout 100% height */
	min-width:100%;
	position: relative;
	overflow: hidden;
}
* html #wrapper { 
	height:100%; /* IE6 treats height as min-height */
	width:100%;
}
div#title {
	width: 800px;
	height: 150px;
	margin-left: auto;
	margin-right: auto;
	position: relative;
	background-image: url('../images/logo.png');
	background-repeat: no-repeat;
	background-position: center left;
}
#menu {
	background: #4F4F72;
	margin: 0 auto;
	color: white;
	font-weight: bold;
	width: 800px;
	height: 32px;
}
#menu ul {
	padding: 0;
	margin: 0;
	list-style-type: none;
}
#menu li.divider {
	width: 6px;
	height: 32px;
	margin: 0;
	padding: 0;
	background-image: url('../images/splitter.png');
}
#menu li {
	float: left;
	margin: 8px;
	border: none;
	display: inline;
}
#content {
	height: 100%;
	position: relative;
	top: 182px;
	background: #E5E5E5;
	width: 800px;
	margin: 0 auto;
}



Where am I going wrong with the content id? I've been trying variations on padding and position forever. Any help would be appreciated. If you could point me to a place where this has already been explained that would be great too, because I'm not quite sure what keywords to use to search in this situation. Thanks!
Was This Post Helpful? 0
  • +
  • -


#2 moopet  Icon User is offline

  • D.I.C Regular
  • PipPipPip

Reputation: 50
  • View blog
  • Posts: 418
  • Joined: 02-April 09


Dream Kudos: 25

Re: Padding and Centering while reaching the bottom

Posted 17 October 2009 - 11:17 PM

View PostRedian, on 18 Oct, 2009 - 04:54 AM, said:

I can get it to the right width, and the right height, but I can't get it to have the right padding on the sides that will keep the 800px width of the layout.

This seems contradictory. Can you make it the correct width or not? Is that your problem? When I paste the code into a test page it shows the grey area centred and 800px, lining up with the header. What do you see?
Was This Post Helpful? 0
  • +
  • -

#3 Redian  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 1
  • View blog
  • Posts: 46
  • Joined: 28-December 07


Dream Kudos: 0

Re: Padding and Centering while reaching the bottom

Posted 18 October 2009 - 08:08 AM

I can make the content area 800px, but it doesn't line up with the header and menu. Is your screen resolution currently set to larger than 800 width?
Was This Post Helpful? 0
  • +
  • -

#4 moopet  Icon User is offline

  • D.I.C Regular
  • PipPipPip

Reputation: 50
  • View blog
  • Posts: 418
  • Joined: 02-April 09


Dream Kudos: 25

Re: Padding and Centering while reaching the bottom

Posted 18 October 2009 - 09:22 AM

View PostRedian, on 18 Oct, 2009 - 03:08 PM, said:

I can make the content area 800px, but it doesn't line up with the header and menu. Is your screen resolution currently set to larger than 800 width?


Yes.
Was This Post Helpful? 0
  • +
  • -

#5 Redian  Icon User is offline

  • New D.I.C Head
  • Pip

Reputation: 1
  • View blog
  • Posts: 46
  • Joined: 28-December 07


Dream Kudos: 0

Re: Padding and Centering while reaching the bottom

Posted 19 October 2009 - 02:15 PM

Any idea why the code doesn't work for me? The image I attached I drew separately. It's not an image of what the code displays.
Was This Post Helpful? 0
  • +
  • -



Fast Reply

  

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users



Live Help!

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter Fan Us On Facebook

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month