Click to See Complete Forum and Search --> : CSS Tabs. How to make active link display the same as the hover attributes
Theremin
10-15-2007, 07:00 PM
I have used this tutorial to make some tabs for my menu and they work fine, but I would like for the active tab to stay active even when not hovered. How would I go about getting that to work?
http://www.webcredible.co.uk/user-friendly-resources/css/css-round-corners.shtml
The webcredible site above has the tabs working as I would like, mine only change color while hovered.
S!
Jason
Centauri
10-15-2007, 07:19 PM
You may have missinterpreted the psuedo class term "active", which means while the mouse button is down. To indicate the current page, there are a couple of methods, but we really need to see the full code of what you are using to give a specific method. One way is to manually assign a class to the particular tab on each page, and style that class the same as the hover. A better way involves using classes (or ids) for each menu tab (which you may or may not already have), and assigning an id to the body tag of each page - the body tag and tab class can then be paired in the css to highlight the correct tab automatically (which is the method used on your example link above).
scragar
10-15-2007, 07:24 PM
you could set the body id to the current page, then make a CSS condition for if the 2 match upbody#HOME li#lnk_home, body#MAP li#lnk_map{that'd work, but's it's always a messy solution.
Theremin
10-15-2007, 07:44 PM
can i do an id in the span tag and that will take precedence over the div that contains it?
i guess i could just try it :P
thanks for the idea :)