0
Wanna highlight a link when you are at it?
ex-if you are at home, your home link will be conpletely highlighted.
7 odpowiedzi
+ 5
The pseudo class 'active' style the link only the time the mouse button is down...
'focus' the time that the link keep the focus ( while not clicking elsewhere )
'hover' the time the mouse is over ( or the time the element keep focus for touch devices )
That's for dynamic styling...
If you want highlight menu entry corresponding to the page ( as a menu item 'activated' ), you have to style it staticly, maybe replacing the <a> link element by another ( you probaly don't want the page reload if the user click on activated/actual menu/page ) ^^
+ 4
@Tarun kumar parashar wrote:
"active ias not doing good as it is for less than 1sec only when it is clicked..."
That's what I was specified in my previous post day before yesterday :P
If you don't reload the page when clicking your menu entry, you can cheat to make them persist, by using the behavior of radio button items ( only one checked at a time / checking one deselect others ) and <label>s ( thanks to the 'for' html attribute, and css3 selectors )...
Else, you just have to handle the onclick event of your menu items/links, to change classes dynamically with JS ^^
+ 2
oh yes active will be used here, visited is for all the links you have clicked
+ 1
use css
a:visited {
}
+ 1
<style>
a:active {
background-color: yellow;
}
</style>
Sorry iam read to fast
0
thanks guys
0
active ias not doing good as it is for less than 1 sec only when it is clicked..