How to remove shadow on click of div in css

WBOY
Release: 2021-11-29 17:43:47
Original
3066 people have browsed it

In CSS, you can use the ":active" selector and the "box-shadow" attribute to remove the shadow effect by clicking on the div. You only need to add "div:active{box-shadow:0 0" to the div element. ;}" style is enough.

How to remove shadow on click of div in css

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

How to remove the shadow by clicking on the div in css

In css, you can use: active selector and box-shadow attribute to remove the shadow by clicking on the div For effect, the :active selector is used to select active links. When you click on a link, it becomes active (activated). The box-shadow property is used to set the shadow of the div.

The example is as follows:

<!DOCTYPE html>
<html>
<head>
    <style> 
        div{
            width:300px;
            height:100px;
            background-color:#ff9900;
            box-shadow: 10px 10px 5px #888888;
        }
        div:active{
            box-shadow: 0 0 ;
        }
    </style>
</head>
<body>
    <div></div>
</body>
</html>
Copy after login

Output result:

How to remove shadow on click of div in css

(Learning video sharing: css video tutorial)

The above is the detailed content of How to remove shadow on click of div in css. 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
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!