使用 CSS 建立具有邊框的連結按鈕


要建立一個帶有邊框的連結按鈕,你可以嘗試執行以下程式碼 -

示例

線上演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         a:link, a:visited {
            background-color: white;
            color: black;
            border: 1px solid blue;
            padding: 30px 30px;
            text-align: center;
            text-decoration: none;
            display: inline-block;
         }
         a:hover, a:active {
            background-color: red;
            color: white;
         }
      </style>
   </head>
   <body>
      <a href = "demo.html" target = "_blank">Demo Link</a>
   </body>
</html>

更新於: 30-Jun-2020

2 千次瀏覽

開啟你的 職業生涯

完成課程獲得認證

開始
廣告
© . All rights reserved.