Home >Web Front-end >CSS Tutorial >How to set shadow for button in css
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.
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:
<!--html代码--> <input class="but" type = "button" value = "确认" />
<!--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>
[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!