What I write below may be very simple to most netizens, but I really don’t know it myself.
There is a piece of html like this:
<div>
<a href="#">
<img alt="i am an img" src="img.jpg"/>
</a>
</div>
Generally, the hover CSS pseudo-class does not work for tags other than the a tag (it works in FF browser, but not in IE6): as follows
img:hover{
border:1px solid #000;/*It works under FF but not under IE6*/
}
What a waste of such a good pseudo-class! ! However, there is actually a way to implement the hover function of non-a tags, as follows:
a:hover img{
border:1px solid #000;/*can be understood as the img tag inside a that the mouse is on*/
}
^0^ It is very simple to implement, no need to edit troublesome JS statements!
Dedicated to friends who love CSS, the above content is the humble opinion of the author Xiao JOE, please reprint it to the famous author: Xiao JOE Address: http://xiebiji.com/ 2008/10/hover