Hi,
I have a navigation with the following html code:
<ul id="nav">
<li><a>home</a></li>
<li><a>login</a></li>
<li class="selected"><a>shop</a></li>
<li><a>help</a></li>
</ul>
What I want to accomplish is that the element with the "selected" class always appears at the left side of the navigation.
So if shop is selected the rendered navigation would look like:
shop home login help
If help is selected:
help home login shop
My css:
#nav li {
display: inline; }
#nav li.selected {
width: 230px;
text-align: center;
background: #b52830;
margin-right: 10px;
float: left;
display: block; }
#nav li.selected a {
display: block;
padding-right: 0; }
#nav li.selected a:hover {
color: #fff; }
It works for certain browser but not for all. Any ideas?
If it does not work the selected element moves beneath the rest...
shop selected:
home login help
shop