1 reply [Last post]
Last seen: 18 years 9 weeks ago
Timezone: GMT+10
Joined: 2004-08-06
Posts: 6
Points: 0


Flushed from the help I've recived to my last post Smile , I have another thorny question:

Is it possible to change the color of a span of text upon mouseover using just CSS, if the span of text in question is not a hyperlink??

e.g.: Say for example I was using the HTML <def> (definition) tag and wanted the text spanned by the <def> to change when the user moused-over it (in addition to its normal behaviour of popping up a definition).

Is this possible to do without resorting to JavaScript or can one only do it if a 'dummy' <a> tag (i.e. ' href="#" ') is used?


Hugo's picture
Last seen: 7 years 39 weeks ago
Joined: 2004-06-06
Posts: 15668
Points: 2806

Changing a non-link text color on rollover (using just CSS i

It is in in Mozi/FF as hover will work on selectors other than <a> IE is the problem as it will only accept hover on an anchor, possible solution is to use the csshover.htc file ( although this is Jscript!)
Here is a link to the csshover file



Before you make your first post it is vital that you READ THE POSTING GUIDELINES!
Please post ALL your code - both CSS & HTML - in [code] tags
Please validate and ensure you have included a full Doctype before posting.
Why validate? Read Me