CSS中的button按钮是我们在网页设计中常用的一个元素,我们可以通过CSS为button按钮添加超链接,增加按钮的功能性。下面是一些实现方法。 首先在HTML中创建一个button按钮。 这是按钮...
CSS中的button按钮是我们在网页设计中常用的一个元素,我们可以通过CSS为button按钮添加超链接,增加按钮的功能性。下面是一些实现方法。
首先在HTML中创建一个button按钮。
<button class="linkbutton">这是按钮</button>
p .linkbutton {
background-color: #4CAF50;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
p .linkbutton:hover {
background-color: #3e8e41;
}
p .linkbutton a {
color: white;
text-decoration: none;
}