在网页设计中,按钮是一个非常重要的元素,可以让用户进行一些关键的操作。而在CSS3中,通过简单的代码就可以实现非常漂亮的按钮样式,而不需要任何图片的帮助。 首先我们需要定义一个基本的按钮样式,代码如下...
在网页设计中,按钮是一个非常重要的元素,可以让用户进行一些关键的操作。而在CSS3中,通过简单的代码就可以实现非常漂亮的按钮样式,而不需要任何图片的帮助。
首先我们需要定义一个基本的按钮样式,代码如下:
button {
background-color: #4287f5;
border: none;
color: #fff;
padding: 15px 25px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
border-radius: 5px;
} button:hover {
background-color: #3366cc;
} button.shadow {
box-shadow: 0px 5px 0px 0px #2ecc71;
} button.gradient {
background: #ff8a00; /* Old browsers */
background: -moz-linear-gradient(top, #ff8a00 0%, #e52e71 100%); /* FF3.6-15 */
background: -webkit-linear-gradient(top, #ff8a00 0%,#e52e71 100%); /* Chrome10-25,Safari5.1-6 */
background: linear-gradient(to bottom, #ff8a00 0%,#e52e71 100%); /* W3C, IE10+, FF16+, Chrome26+, Opera12+, Safari7+ */
}