使用CSS3按钮可以让网站页面更具有美观性和交互性。下面是一些关于CSS3按钮的基本使用方法。 首先,我们需要在HTML代码中使用button标签来定义我们的按钮。例如: 点击我 在CSS样式表中,...
使用CSS3按钮可以让网站页面更具有美观性和交互性。下面是一些关于CSS3按钮的基本使用方法。
首先,我们需要在HTML代码中使用button标签来定义我们的按钮。例如:
<button class="my-btn">点击我</button> .my-btn {
background-color: #3498db;
border: none;
color: white;
padding: 10px 20px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
border-radius: 5px;
transition: all 0.3s ease;
cursor: pointer;
} .my-btn:hover {
background-color: #2980B9;
}
.my-btn:active {
background-color: #1E8BC3;
} .my-btn2 {
background: linear-gradient(to bottom right, #3498db, #2980b9);
box-shadow: 0px 5px 0px 0px #1E8BC3;
}