Home > Web Front-end > CSS Tutorial > How to set shadow for button in css

How to set shadow for button in css

藏色散人
Release: 2023-01-03 09:31:04
Original
4836 people have browsed it

How to set a shadow for a button using css: first create an HTML sample file; then set a button button; and finally add attributes such as "box-shadow" to the button to achieve the shadow effect.

How to set shadow for button in css

The operating environment of this article: Windows7 system, HTML5&&CSS3 version, DELL G3 computer

css3 makes a button button with a shadow

Effect comparison before and after swiping the mouse:

How to set shadow for button in css

<!--html代码-->
<input class="but" type = "button" value = "确认" />
Copy after login
<!--css代码-->
<style type="text/css">
 .but{
 border: 0px groove orange;
 box-shadow: 5px 6px 10px #000;
 margin-left: 160px;
 border-radius: 10px;
 background: #034c92;
 color: white;
 width: 250px;
 height: 40px;
 font-size: 20px;
 }
 .but:hover{
 box-shadow: 8px 10px 10px #000;
 background: #005DF9;
 }
 </style>
Copy after login

[Recommended learning: css video tutorial]

The above is the detailed content of How to set shadow for button 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