The implementation of the background color of the mouse has a lot of methods, today we are introducing the method to implement with Css+div.
Method One
#div: Hover{background: #000000;}
Explanation: Background discoloration When the mouse passes the element with ID Div
IE6.0, Firefox2.0, Opera 9.23.
Method Two
<div onmouseover= "this.style.backgroundcolor= ' #F4F9FD" "onmouseout=" this.style.backgroundcolor= ' #FFFFFF ' "> </div>
Method Three:
<style>
. D_over{background-color: #307172;}
. D_out{background-color: #EFEFEF;}
</style>
<div class= "D_out" onmouseover= "this.classname= ' D_over '" "onmouseout=" This.classname= ' d_out ' "" > hahaha haha </div >
The <a> label is OK, but this will cause other <a> labels to also follow the discoloration.
is typically used to define the style of a link, not to define a region. Now commonly used div+css Web pages, Div is to express the meaning of the area, or like to use this, of course, with a table, there will be a simpler way.
In fact, the use of more of the <a> tag is implemented.
<style>
a {color:red; width:100px; height:22px; line-height:22px;}
a:hover {background: #f4f4f4; color: #000;}
</style>
Note: More wonderful articles please pay attention to the triple Web Design Tutorial section.