View Single Post
Old 11-06-2011, 02:53 AM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello seer,
To center an element you need three things:
  1. a valid DocType
  2. an element with a width
  3. that elements right/left margins set to auto
Right now, your #header and #info are full width elements. #header is centered by the background properties you put on it.
#info might be centered like this:
Code:
#info {
background: #fff;
margin: 120px 0 0 -190px;
position:fixed;
height: 30px;
left: 50%;
}
This would work if you got #header and #info out of#content -
Code:
#wrapper {
clear:none;
margin: 0px auto;
padding: 0px;
width: auto;
height: 715px;
overflow: auto;
}
#info {
background: #fff;
display: table-row;
margin-top: 150px;
margin-left: auto;
margin-right: auto;
display: block;
width: 300px;
height: 30px;
text-align: center;
}
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

Last edited by Excavator; 11-06-2011 at 03:03 AM..
Excavator is offline   Reply With Quote
Users who have thanked Excavator for this post:
seer (11-06-2011)