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  >  Article  >  Web Front-end  >  How to set button style with css

How to set button style with css

little bottle
little bottleOriginal
2019-05-21 15:35:459639browse

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>

How to set button style with css

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;
   }

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!

Statement:
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