Home > Web Front-end > CSS Tutorial > How to set button style with css

How to set button style with css

little bottle
Release: 2019-05-21 15:36:14
Original
9687 people have browsed it

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.

How to set button style with css

1. Button button (no style)

<button>默认按钮</button>
Copy after login

How to set button style with css

2. Button button (with style)

HTML code:

<button class="button">按钮</button>
Copy after login

CSS part:

.button {
       background-color: #4CAF50;
       border: none;
       color: white;
       padding: 15px 32px;
       text-align: center;
       font-size: 16px;
       cursor: pointer;
   }
Copy after login

How to set button style with css

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!

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 Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template