How to use css3 to achieve shadow effect when mouse hovers

WBOY
Release: 2021-12-14 18:26:39
Original
6005 people have browsed it

In CSS, you can use the ":hover" selector and the "box-shadow" attribute to achieve the shadow effect when the mouse is hovering. The syntax is "element:hover{box-shadow: horizontal shadow position vertical shadow Location;}".

How to use css3 to achieve shadow effect when mouse hovers

The operating environment of this tutorial: Windows 10 system, CSS3&&HTML5 version, Dell G3 computer.

How to use css3 to achieve the shadow effect when the mouse is hovering

In css, if you want to achieve the shadow effect when the mouse is hovering, This can be achieved using the ":hover" selector and the "box-shadow" attribute.

The box-shadow property can set one or more drop-down shadow boxes.

The example is as follows:

      Document  
  
Copy after login

Output result:

How to use css3 to achieve shadow effect when mouse hovers

(Learning video sharing:css video tutorial)

The above is the detailed content of How to use css3 to achieve shadow effect when mouse hovers. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
css
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
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!