Button. Then write the style in .button{} in CSS. The main elements are border, color, etc."/> Button. Then write the style in .button{} in CSS. The main elements are border, color, etc.">
Home >Web Front-end >CSS Tutorial >How to set button style with css
Many websites need to use buttons. A good-looking and practical CSS button can not only give visitors a sense of beauty, but also facilitate developers. Below is a pure CSS button, you can refer to it if you need it.
1. Button button (no style)
<button>默认按钮</button>
2. Button button (with style)
HTML code:
<button class="button">按钮</button>
CSS part:
.button { background-color: #4CAF50; border: none; color: white; padding: 15px 32px; text-align: center; font-size: 16px; cursor: pointer; }
This way you can make a button with style, isn’t it very simple?
The above is the detailed content of How to set button style with css. For more information, please follow other related articles on the PHP Chinese website!