【发布时间】:2020-02-18 22:47:10
【问题描述】:
我正在创建一个按钮,当您将鼠标悬停在它上面时会显示说明。但是我想在点击后转到一个链接,我如何将链接添加到按钮,因为我有一个悬停:before {content:"New Text"}
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"}
<html>
<head>
</head>
<body>
<button class="button"><span> Old text </span></button>
</body>
</html>
【问题讨论】:
-
那么,您已经完成了悬停文本更改,但需要在点击时转到特定链接?