CSS 基础学习-105 css 制作链接按钮样式

hrs 提交于 2021/10/15 - 22:50 , 周五

实例代码:

<!doctype html>
<html>
  <head>
    <style>
      a{
        font-size:20px;
        background-color:blue;
        color:yellow;
        padding:5px 15px;
        text-decoration:none;
        display:inline-block;
      }
      a:hover{
        background-color:red;
      }
      a:active{
        background-color:green;
        color:white;
      }
    </style>
  </head>
  <body>
    <h1>CSS 链接按钮</h1>
    <p>把链接样式设置为按钮:</p>
    <a href="https://www.dwoke.com" target="_blank">你行网</a>  
    <a href="https://www.dwoke.com" target="_blank">你行网</a>
    <a href="https://www.dwoke.com" target="_blank">你行网</a>
  </body>
</html>

运行效果:

css-105_0.png

标签