saskatchewandav
06-07-2009, 02:00 AM
Hello, very simple question here. I'm not sure why I cannot get my css to format my nav bar how I want.
What I am after, is a basic one color background navbar that stretches the whole screen width.
2 problems so far!!!
#1 - I can't get it to expand the width of the page, it only goes as long as the text links themselves.
#2 - there is still a little margin on the left side, it's not quite flush with the page.
I am styling an unordered list, here's both my html and css code:
HTML:
<div id="navbar">
<ul>
<li><a href="#">NEWS</a></li>
<li><a href="#">ART</a></li>
<li><a href="#">MUSIC</a></li>
<li><a href="#">FILM</a></li>
<li><a href="#">CONTACT</a></li>
</ul></div>
CSS:
body {
background-color: #000000;
background-image: url(images/logo.jpg);
background-repeat: no-repeat;
}
#navbar {
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
letter-spacing: 1px;
font-size: 16px;
margin: 0px;
padding: 0px;
width: 100%;
}
#navbar ul{
margin: 0px;
padding: 0px;
display: inline;
list-style-type: none;
float: left;
}
#navbar li{
margin: 0px;
padding: 0px;
display: inline;
background-color: #003366;
}
#navbar a:link, #navbar a:visited{
text-decoration: none;
color:#ffffff;
}
#navbar a:hover{
color:#000000;
}
Please help, thanks!
What I am after, is a basic one color background navbar that stretches the whole screen width.
2 problems so far!!!
#1 - I can't get it to expand the width of the page, it only goes as long as the text links themselves.
#2 - there is still a little margin on the left side, it's not quite flush with the page.
I am styling an unordered list, here's both my html and css code:
HTML:
<div id="navbar">
<ul>
<li><a href="#">NEWS</a></li>
<li><a href="#">ART</a></li>
<li><a href="#">MUSIC</a></li>
<li><a href="#">FILM</a></li>
<li><a href="#">CONTACT</a></li>
</ul></div>
CSS:
body {
background-color: #000000;
background-image: url(images/logo.jpg);
background-repeat: no-repeat;
}
#navbar {
font-weight: bold;
font-family: Arial, Helvetica, sans-serif;
letter-spacing: 1px;
font-size: 16px;
margin: 0px;
padding: 0px;
width: 100%;
}
#navbar ul{
margin: 0px;
padding: 0px;
display: inline;
list-style-type: none;
float: left;
}
#navbar li{
margin: 0px;
padding: 0px;
display: inline;
background-color: #003366;
}
#navbar a:link, #navbar a:visited{
text-decoration: none;
color:#ffffff;
}
#navbar a:hover{
color:#000000;
}
Please help, thanks!