SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: a:active won't work correctly
-
Jun 8, 2007, 19:26 #1
- Join Date
- Feb 2007
- Location
- Northern California
- Posts
- 9
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
a:active won't work correctly
Using the sytle below the a:active does not work as expected.
The active link style is only displayed when the mouse is down.
I took a wild shot at one idea and put a '#' after the link in the href and now it stays active if one clicks twice on the image link (in IE anyway, in FF Mac it fails)
<p><a href="links.php#"></a></p>
<p><a href="links2.php#"></a></p>
http://etrips.com/TESTs/links.php
a { /* a:link doesn't display gif? */
display:block;
width: 62px;
height: 26px;
color:#333;
text-decoration: none;
background-image: url(../grafbits/navbar/Nav_02-RollOver.gif);
background-repeat: no-repeat;
background-position: 0 0;
font-size: 10px;
}
a:active {
background-position: 0 -52px;
width: 62px;
height: 26px;
color: #FFF;
}
a:hover {
background-position: 0 -26px;
width: 62px;
height: 26px;
color: #049;
}
Thanks
sam
P.S. Why do these technologies work so poorly? And why are these forums designed for 10 year olds?
-
Jun 8, 2007, 21:33 #2
- Join Date
- May 2007
- Location
- Newcastle, Australia
- Posts
- 3,718
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
That is exactly what the :active state is supposed to do...
If you want the link to be styled to indicate it is the current page, then you could either set and style a "current" class and assign that to the appropriate link on each page, or assign a class to each menu item and a body id to each page, and set the style based on id / class combination.
Bookmarks