Hi,
I am trying to centre my overall website leaving a gap either side. Then I am trying to seperate my website into different sections. I would like to have a box around my navigation buttons and the a box around my main content. Also I am having problems when I hover over each of my figures/links. Each time it grows out as if there is extra padding in there for the hover command. my website is www.newcityexplorer.com
border: 1px double #333333;
font-size: 16px;
margin: 5px auto;
overflow: hidden;
padding: 12px;
width: 925px;
}
margin: 5px auto;
puts 5px top and bottom and distributes left and right margins equally which is what centers the page.
Martin
The page is not centering because you are writing the margin twice in the css
#container {
width: 925px; /*
adjust width as needed
*/
margin:0 auto; /*
with width, this is centered on screen
*/
padding: 12px;
font-size: 16px;
background:#FFF;
overflow:hidden; /*
to contain floats
*/
border: 1px double #333;
margin: 5px 0px;
}
see where you have margin:0 auto; at the top... that is used to center #container.... but then you are overwriting that with margin: 5px 0px; down at the bottom.... remove that line and just set the margin once.
If you want a border around an element, using a border is one way to accomplish that:
http://www.w3schools.com/css/css_border.asp
Best wishes,
Adninjastrator
North America
Europe, Middle East and Africa
Asia Pacific