Log in

View Full Version : Resolved Menu error when back button pressed



keyboard
07-24-2011, 10:59 PM
Hi everyone,

I've been surfing the internet and found this


<html>
<head>
</head>
<body>


<body style="background-color:lightgreen">

<center>
<ul id="list-nav">
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Contact</a></li>
</ul>
</center>
<style type="text/css">

ul#list-nav {
list-style:none;
margin:20px;
padding:0;
width:525px
}

ul#list-nav li {
display:inline
}

ul#list-nav li a {
text-decoration:none;
padding:5px 0;
width:100px;
background:#485e49;
color:#eee;
float:left;
text-align:center;
border-left:1px solid #fff;
}

ul#list-nav li a:hover {
background:#a2b3a1;
color:#000
}


</style>
</body>
</html>

It's a bar of links that goes across the top of a page. It works fine unless you visit another page then go back to it using the back button. Then the links go diagonal and it goes wierd. Any help would be appreciated

CChawps
07-25-2011, 05:52 AM
Try this


<style type="text/css">
#nav li {
list-style-type: none;
float: left;
}

#nav li A {
background: #485e49;
color: #EEE;
text-decoration: none;
padding: 6px 8px 6px 8px;
border-right: 1px solid #FFF;
}

#nav li A:hover {
background: #a2b3a1;
color: #000;
}
</style>

<ul id="nav">
<li><a href="#">Home</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Services</a></li>
<li><a href="#">Products</a></li>
<li><a href="#">Contact</a></li>
</ul>

Toby