straightcash
09-15-2011, 05:07 PM
Hi,
I'm having trouble centering a navigation pane on this page. The CSS looks like this:
body{
background-color:black;
margin:150px 300px;
border-style:groove;
border-width:5px;
border-color:white;
width:900px;
height:700px;
}
.title{
margin-left:auto;
margin-right:auto;
width:55%
}
ul
{
list-style-type:none;
margin:0;
padding:0;
overflow:hidden;
}
li
{
float:left;
}
a:link,a:visited
{
display:block;
width:120px;
font-weight:bold;
color:#FFFFFF;
background-color:#98bf21;
text-align:center;
padding:4px;
text-decoration:none;
text-transform:uppercase;
}
a:hover,a:active
{
background-color:#7A991A;
}
And the HTML looks like this:
<body>
<div class="title">
<img src="Title Bar - New Guard Logo.png" alt="Title Heading" width="500" height="150"/>
</div>
<ul>
<li><a href="#index">The Mission</a></li>
<li><a href="#work">The Work</a></li>
<li><a href="#people">The People</a></li>
<li><a href="#contact">The Contact</a></li>
</ul>
</body>
</html>
I've tried a bunch of ways to center it, but I know there is something simple I'm missing. Can anyone help me out?
Thanks!
I'm having trouble centering a navigation pane on this page. The CSS looks like this:
body{
background-color:black;
margin:150px 300px;
border-style:groove;
border-width:5px;
border-color:white;
width:900px;
height:700px;
}
.title{
margin-left:auto;
margin-right:auto;
width:55%
}
ul
{
list-style-type:none;
margin:0;
padding:0;
overflow:hidden;
}
li
{
float:left;
}
a:link,a:visited
{
display:block;
width:120px;
font-weight:bold;
color:#FFFFFF;
background-color:#98bf21;
text-align:center;
padding:4px;
text-decoration:none;
text-transform:uppercase;
}
a:hover,a:active
{
background-color:#7A991A;
}
And the HTML looks like this:
<body>
<div class="title">
<img src="Title Bar - New Guard Logo.png" alt="Title Heading" width="500" height="150"/>
</div>
<ul>
<li><a href="#index">The Mission</a></li>
<li><a href="#work">The Work</a></li>
<li><a href="#people">The People</a></li>
<li><a href="#contact">The Contact</a></li>
</ul>
</body>
</html>
I've tried a bunch of ways to center it, but I know there is something simple I'm missing. Can anyone help me out?
Thanks!