I have a basic menu bar not unlike the SO one next to the logo (so questions, tags etc.). I have all the styling, but it changes when I add links in. This is hard to explain, so here is my menubar styling:
div.menubar ul
{
background-color:#FF0000;
list-style-type:none;
margin:0;
padding:0;
padding-top:6px;
padding-bottom:6px;
}
div.menubar li
{
display:inline;
margin:0;
padding:0;
}
div.menubar a:hover, div.menubar a:active
{
background-color:#00FF00;//should highlight in green on mouseover
}
div.menubar a:link, div.menubar a:visited
{
font-weight:bold;
color:#FFFFFF;
background-color:#FF0000;
text-align:center;
padding:6px;
text-decoration:none;
text-transform:uppercase;
}
And the menubar code:
<div class = "menubar">
<ul>
<li><a href="home.php">Home</a></li><!--does not work-->
<li><a href="#news">News</a></li><!--works-->
<li><a href="#contact">Contact</a></li>
<li><a href="#about">About</a></li>
</ul>
</div>
When the link href is something like #home
the link background changes to green on mouseover. However, when the link href is home.php
, nothing happens. Why is this happening?