将链接添加到悬停文本更改按钮上吗?

问题描述 投票:0回答:1

我正在创建一个按钮,当将鼠标悬停在该按钮上时会显示说明。但是我想单击链接后,由于悬停了,如何将链接添加到按钮:在{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>
html button onhover
1个回答
0
投票

我宁愿建议链接样式像按钮。这样,您将获得悬停效果,内容更改以及链接...

<a href="#your_link#" class="button">Old text</a>

© www.soinside.com 2019 - 2024. All rights reserved.