Login | Register   
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Web
Expertise: Intermediate
Nov 17, 1998

Highlight Content in Response to User Mouseover Using DHTML/CSS

You can use Dynamic HTML and Cascading Style Sheets (CSS) to change the color of text on the fly. This functionality can be useful for highlighting a portion of text. This feature appears to have been implemented in Internet Explorer 4, but not in Netscape 4.x.
 
<FONT FACE="Arial"><B>Canine sweaters available in 
</B></FONT><B><FONT FACE="Arial" COLOR="#777777">

<SPAN ONMOUSEOVER="this.style.color = '#0000CC';" 
ONMOUSEOUT="this.style.color = '#999999';">blue</SPAN></FONT>
<FONT FACE="Arial"> or </FONT><FONT FACE="Arial" COLOR="#777777">
<SPAN ONMOUSEOVER="this.style.color = '#663300';" 
ONMOUSEOUT="this.style.color = '#999999';">brown</SPAN></FONT></B>
See this code in action:

Canine sweaters available in blue or brown

Erik Goetze
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap