NotionCommotion
01-18-2007, 11:08 AM
I am trying to implement navigation rollover using CSS. The below div is included on each page of my site. Each tab of the navigation bar has a background graphic (i/rollover.gif) that is positioned to indicate whether the tab is being or has been selected. Most of the tabs are linked directly to their associated page except for Page 4 which utilizes a little js to ensure the user is authorized to access the page. It works in regard to changing based on whether the tab is being selected, however, unfortanately the position of the graphic changes back after the page is selected. Any suggestion how to make show the current page as being selected? Thanks
<div id="navigation">
<ul>
<li><a href="/page1.html">Page 1</a></li>
<li><a href="/page1.html">Page 2</a></li>
<li><a href="/page1.html">Page 3</a></li>
<li><a href="javascript:page_4()">Page 4</a></li>
</ul>
</div>
#navigation ul {
list-style-type: none;
padding: 0;
margin: 0;
}
#navigation li {
float: left;
margin: 0px;
padding: 0px;
display: inline;
background: url(/i/rollover.gif) no-repeat left top;
border-bottom: 5px solid #777777;
}
#navigation a {
font: bold 13px Arial, Helvetica, sans-serif;
text-transform: uppercase;
color: #ffffff;
text-decoration: none;
display: block;
padding: 7px 0px 0px 30px;
height: 30px;
width: 144px;
voice-family: "\"}\"";
voice-family:inherit;
height: 23px;
width: 114px;
}
#navigation a {
text-transform: uppercase;
}
#navigation a:hover {
background: url(/i/rollover.gif) 0px -40px;
}
#navigation a:active {
background: url(/i/rollover.gif) 0px -80px;
}
<div id="navigation">
<ul>
<li><a href="/page1.html">Page 1</a></li>
<li><a href="/page1.html">Page 2</a></li>
<li><a href="/page1.html">Page 3</a></li>
<li><a href="javascript:page_4()">Page 4</a></li>
</ul>
</div>
#navigation ul {
list-style-type: none;
padding: 0;
margin: 0;
}
#navigation li {
float: left;
margin: 0px;
padding: 0px;
display: inline;
background: url(/i/rollover.gif) no-repeat left top;
border-bottom: 5px solid #777777;
}
#navigation a {
font: bold 13px Arial, Helvetica, sans-serif;
text-transform: uppercase;
color: #ffffff;
text-decoration: none;
display: block;
padding: 7px 0px 0px 30px;
height: 30px;
width: 144px;
voice-family: "\"}\"";
voice-family:inherit;
height: 23px;
width: 114px;
}
#navigation a {
text-transform: uppercase;
}
#navigation a:hover {
background: url(/i/rollover.gif) 0px -40px;
}
#navigation a:active {
background: url(/i/rollover.gif) 0px -80px;
}