HTML创建带颜色有立体感的超链接按钮完整代码
<!DOCTYPE html>
<html>
<head>
<style>
.button {
display: inline-block;
border-radius: 4px;
background-color: #f4511e;
border: none;
color: #FFFFFF;
text-align: center;
font-size: 28px;
padding: 20px;
width: 200px;
transition: all 0.5s;
cursor: pointer;
margin: 5px;
text-decoration: none;
}
.button span {
cursor: pointer;
display: inline-block;
position: relative;
transition: 0.5s;
}
.button span:after {
content: '\00bb';
position: absolute;
opacity: 0;
top: 0;
right: -20px;
transition: 0.5s;
}
.button:hover span {
padding-right: 20px;
}
.button:hover span:after {
opacity: 1;
right: 0;
}
</style>
</head>
<body>
<a href="https://www.example.com" class="button" target="_blank">
<span>点击这里</span>
</a>
</body>
</html>
这段代码使用了CSS样式创建了一个立体感超链接按钮,当鼠标悬停在按钮上时,右侧会出现箭头符号,增加了界面的交互感。
评论已关闭