CodeAve.com CodeAve.com - CSS - Miscellaneous
ASP
JavaScript
CSS
·Basics
·Page Display
·Text Display
·Script Writers
·Contents
·What's New?
HTML
Maps
Links
Mail List
Search
Sitemap


 


Text Hover Colors
Mixing CSS commands and JavaScript can bring about some interesting effects. In the following example we place text between span tags and add JavaScript commands for onMouseOver and onMouseOut that will change the CSS display. When the mouse is not on the text it will display as black. When the mouse is moved over the text it will change to red.
View the Output
Text View
Print View
Mail this Link
Download the Code

<html>
<title>CodeAve.com/CSS - Text Hover Colors</title>
<body bgcolor="#FFFFFF">

<!-- 
Utilizing the JavaScript onMouseOver and onMouseOut commands
you can define color attributes for text when the mouse hovers
over and off selected text
-->

<span 
onMouseOver = "this.style.color = '#FF0000';" 
onMouseOut = "this.style.color = '#000000';"> 

Four score and seven years ago our fathers <br>
brought forth on this continent a new nation, <br>
conceived in liberty and dedicated to the proposition <br>
that all men are created equal. Now we are engaged in a <br>
great civil war, testing whether that nation or any nation so <br>
conceived and so dedicated can long endure. 
</span>

</body>
</html>

 

 

 



ASP: What's New? | Articles | Script Writers | Database Display | Read/Write
Server Variables | Response Objects | Random Events | Miscellaneous
HTML: Forms | Hyperlinks | Headers | Tables | Hyperlinks | Headers | Text Display
JavaScript: Document Info | Forms | Images | Navigation | Script Writers
CSS: Basics | Page Display | Text Display | Script Writers | Miscellaneous
Links | Search Engine db |  Privacy Statement |  Advertising Rates |  Email

CodeAve.com is hosted by MyHosting.com
Donate Food Online with a Mouse Click at TheHungerSite.com
Donate Land Online with a Mouse Click at TheRainForestSite.com
© 1999 - 2010 CodeAve.com
All Rights Reserved