CSS DIV enables the background to change color when the mouse passes over it_html/css_WEB-ITnose

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

There are many ways to change the background color when the mouse passes over it. Today we will introduce the method using CSS DIV.

Method 1

The following is the quoted content:
以下为引用的内容:

#div:hover{background:#000000;}

#div:hover{background:#000000;}

Explanation: The background changes color when the mouse passes over the element with the id of div

IE6.0, Firefox2.0, Opera 9.23 does not work

Method 2

以下为引用的内容:

The following is the quoted content:

Method 3:

以下为引用的内容:

哈哈哈哈哈

The following is the quoted content:

Hahahahaha< ;/div>

tags are OK, but this will cause other tags with to also change color.

Generally
is used to define the style of the link, not a certain area. Nowadays, div is commonly used in CSS web pages. div means area. I still like to use this. Of course, if you use table, there will be a simpler method.

以下为引用的内容:

In fact, the tag is more commonly used now.

The following is the quoted content:
In this way, as long as it is connected, it will change. You can use it in a certain area, and all the connections in a certain area will change color when the mouse passes.
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