Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

CSS Forum


You are currently viewing our CSS Forum as a guest. Please register to participate.
Login



Reply
can one suppress the li :hover based on class?
Old 03-10-2009, 06:37 PM can one suppress the li :hover based on class?
Super Talker

Posts: 116
Trades: 0
All,

I have to modify a menu where the style sheet is set with like this:

#mainNav li:hover, #mainNav a:hover

I want to suppress the hover with I decide to use a class with the li or a.

ex: #mainNav li.off (no hover)

Is there a way to suppress the hover based on a class?

Does this make sense? In other words, I want to keep the site wide li:hover but I want to suppress it later in a class.

Thanks
DonnaZ is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-10-2009, 07:06 PM Re: can one suppress the li :hover based on class?
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
Heres a good tut on doing what you want:
http://css.maxdesign.com.au/listutorial/roll11.htm
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Old 03-12-2009, 02:47 PM Re: can one suppress the li :hover based on class?
Super Talker

Posts: 116
Trades: 0
Thanks but the site didn't help at all. I can't use ID's as there ID's there for the JavaScript. I'm going to need to try to do this with a class.
DonnaZ is offline
Reply With Quote
View Public Profile
 
Old 03-12-2009, 03:05 PM Re: can one suppress the li :hover based on class?
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
You can use a class in combination with the :hover selector like this:

Code:
li.myclass:hover {
/*override one rule with another here*/
}
You can do the same thing with an ID
__________________
Join me on
Please login or register to view this content. Registration is FREE
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 03-12-2009, 03:58 PM Re: can one suppress the li :hover based on class?
racer x's Avatar
Ultra Talker

Posts: 457
Name: Randy
Location: Northern Wisconsin
Trades: 0
That site just used id's for an example assuming that you typically wouldn't need that effect anywhere else on the page. As wayfarer said, just use a class. The css just needs to know what you're referring to.

I don't see how ex: #mainNav li.off (no hover) affects the <a> link?

Did you mean #mainNav li a.off:link ?
racer x is offline
Reply With Quote
View Public Profile Visit racer x's homepage!
 
Reply     « Reply to can one suppress the li :hover based on class?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.58949 seconds with 12 queries