HighDots Forums  

How do I get the text to change color on hover?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss How do I get the text to change color on hover? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Big Moxy
 
Posts: n/a

Default How do I get the text to change color on hover? - 08-04-2009 , 08:45 PM






http://zclientdev.net/test2.html
CSS - http://zclientdev.net/default.css

My css works fine when I hover the text but when I hover the area
around the text the color does not change. Your advice is appreciated.

Reply With Quote
  #2  
Old   
Joshua Cranmer
 
Posts: n/a

Default Re: How do I get the text to change color on hover? - 08-04-2009 , 08:59 PM






Big Moxy wrote:
Quote:
http://zclientdev.net/test2.html
CSS - http://zclientdev.net/default.css

My css works fine when I hover the text but when I hover the area
around the text the color does not change. Your advice is appreciated.
In short: change .a:hover to .b:hover > .a.
In long: the .a rule is overriding the settings in .b:hover, as it
manually specifies the color. You therefore need something to override
the .a rule, which is satisfied by the .b:hover > .a rule or the
..a:hover rules.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth

Reply With Quote
  #3  
Old   
Big Moxy
 
Posts: n/a

Default Re: How do I get the text to change color on hover? - 08-04-2009 , 09:40 PM



On Aug 4, 5:59*pm, Joshua Cranmer <Pidgeo... (AT) verizon (DOT) invalid> wrote:
Quote:
Big Moxy wrote:
http://zclientdev.net/test2.html
CSS -http://zclientdev.net/default.css

My css works fine when I hover the text but when I hover the area
around the text the color does not change. Your advice is appreciated.

In short: change .a:hover to .b:hover > .a.
In long: the .a rule is overriding the settings in .b:hover, as it
manually specifies the color. You therefore need something to override
the .a rule, which is satisfied by the .b:hover > .a rule or the
.a:hover rules.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth
I'm sorry for being dense here but I don't understand your notations.
I tried changing .a:hover to .b:hover and vice-versa but that
eliminated the white text altogether. Is that what should happen given
the other rules?

Reply With Quote
  #4  
Old   
Joshua Cranmer
 
Posts: n/a

Default Re: How do I get the text to change color on hover? - 08-04-2009 , 10:13 PM



Big Moxy wrote:
Quote:
On Aug 4, 5:59 pm, Joshua Cranmer <Pidgeo... (AT) verizon (DOT) invalid> wrote:
Big Moxy wrote:
http://zclientdev.net/test2.html
CSS -http://zclientdev.net/default.css
My css works fine when I hover the text but when I hover the area
around the text the color does not change. Your advice is appreciated.
In short: change .a:hover to .b:hover > .a.
In long: the .a rule is overriding the settings in .b:hover, as it
manually specifies the color. You therefore need something to override
the .a rule, which is satisfied by the .b:hover > .a rule or the
.a:hover rules.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth

I'm sorry for being dense here but I don't understand your notations.
I tried changing .a:hover to .b:hover and vice-versa but that
eliminated the white text altogether. Is that what should happen given
the other rules?
The entire rule would be:
..b:hover > .a {
/* decls here */
}

The `>' is the child selection operator, selecting all children matching
..a of nodes matching .b:hover.

--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth

Reply With Quote
Reply




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.