css怎么设置按钮样式

2020-07-23 08:25:08
在许多网站中都需要实用到按钮,一个好看实用的css按钮即可以给访问者以美感,又可以方便开发者。下面就是一个纯css按钮,需要的可以参考一下。

1、button按钮(无样式)

<button>默认按钮</button>

111.jpg

2、button按钮(有样式)

HTML代码:

<button class="button">按钮</button>

CSS部分:

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

222.jpg

这样就可以做出一个含有样式的按钮啦,是不是很简单?