在网页设计中,我们常常需要用到按钮来进行页面跳转。在CSS中,按钮的跳转功能可以通过设置按钮的链接地址实现。 首先,我们需要在HTML中添加一个按钮。按钮的代码如下所示: 跳转 接下来,我们需要使...
在网页设计中,我们常常需要用到按钮来进行页面跳转。在CSS中,按钮的跳转功能可以通过设置按钮的链接地址实现。
首先,我们需要在HTML中添加一个按钮。按钮的代码如下所示:
<button>跳转</button>
button {
background-color: #4CAF50;
color: white;
padding: 12px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
}
<br>
a.button {
text-decoration: none;
color: white;
}
<a href="https://www.example.com" class="button"><button>跳转</button></a>