H I O X INDIA
FREE CSS Tutorial
 HOME  ||  Scripts  ||  Purchase  ||  Tutorials  ||  Images  ||  Tools  ||  Templates 
  :-)  Send Page   :-)   Feedback   :-)   Register   :-)   Links   :-)   Support   :-)
Español Français 中文 Deutsch Portuguese Japanese தமிழ்
 Forums   Hosting   Internet Stats   Easy Calculation   FUN Games 

CSS Topics
Introduction
Types
Background Properties
Text Properties
Font Properties
BOX Properties
Border Properties
Margin Properties
Padding Properties
Special Topics
Ask Your Doubts
More about CSS
Feedback





onMouseOver Effects


Topic

How to Make onMouseover Effects?
How to make the link color or background color change when mouse is moved over?



Topic

Property: onMouseOver Effects


Text Effects:

e.g:hioxindia.com

Its very simple to do this. Just follow the steps and you can do it.

Step 1:
In head portion add style that you want the text to change, as follows
<head>
<style>
/*This is how the text will look before mouse over*/
.colc{
font-family: san-serif;
color: #9EFF36;
}

/*This is how the text will look on mouse over. Note "hover" is the most important change here*/
.colc:hover
{
font-family: san-serif;
color: #456745;
}
</style>
</head>


Step 2:
Set the style to the text for which you want the mouse over effect to happen
e.g:
<a href="" class="colc"> This is the Mouse Over Text </a>

Note: Here we set the style with the tag "class". The style name is "colc" that was created in header portion

-----------------------------

To make the background color to change, just add "background-color" property in style tags as explained above.
E.g: Form the style as
.colc2{
font-family: san-serif;
color: #9EFF36;
}

/*This is how the text will look on mouse over. Note "hover" is the most important change here*/
.colc2:hover
{
background-color: #245250;
}


set this style to the html tag
<a href="" class="colc2"> This is the On MouseOver Effect </a>







A Note
CSS - Cascading Style Sheets can be used along with html tags as explained in this site. This simple CSS will help you to create much elegant and neat html web pages. This does not need any additional softwares or codings. All web browser are capable of handing CSS codes.

Note 2: If required you can using <span> instead of <div> tags. div tag will start and end on new lines. span will not exceed the tag area.


privacy policy     license     sitemap
© 2004-2010 HIOX INDIA