CSS+DIV实现鼠标经过背景变色_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:32:44
Original
1246 people have browsed it

实现鼠标经过背景变色的方法有很多,今天我们介绍的是用CSS+DIV实现的方法。

方法一

 

以下为引用的内容:

#div:hover{background:#000000;}

解释:鼠标经过id为div的元素时背景变色

IE6.0、Firefox2.0、Opera 9.23都不行

方法二

 

以下为引用的内容:

方法三:

 

以下为引用的内容:

哈哈哈哈哈

的标签是可以,可是,这样子会导致其它带有标签的也跟着变色。

一般是用来定义链接的样式的,并不是定义某个区域的。现在常用的div+css的网页用,div就是表示区域的意思,还是喜欢用这种,当然用table的话,会有更简单的方法。

 

其实现在用的较多的是用标签实现的。

 

以下为引用的内容:

这样只要是代连接的都会变哦,你可以在某区域用,则某区域里面的所有来连接的都会鼠标经过变色。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!