我正在创建一个按钮,当将鼠标悬停在该按钮上时会显示说明。但是我想单击链接后,由于悬停了,如何将链接添加到按钮:在{content:“ New Text”}
之前<html>
<head>
<style>
button {width:20em}
button {height:5em}
button {
box-shadow:inset 34px 0px 0px -15px #88bd40;
background-color:#000000 ;
border:1px solid #ffffff;
display:inline-block;
cursor:pointer;
color:#ffffff;
font-family:Arial;
font-size:15px;
font-weight:bold;
padding:9px 23px;
text-decoration:none;
text-shadow:0px -1px 0px #7a2a1d;
}
button:hover span {display:none}
button:hover {
background-color:#4c4c4c;}
button:hover:before {content:"New Text"}
</style>
</head>
<body>
<button class="button"><span> Old text </span></button>
</body>
</html>
我宁愿建议链接样式像按钮。这样,您将获得悬停效果,内容更改以及链接...
<a href="#your_link#" class="button">Old text</a>