如何使用 CSS 为按钮添加彩色边框?

原创
ithorizon 5个月前 (10-19) 阅读数 42 #CSS

要添加有颜色的边框,请使用CSS的border属性。

示例

您可以尝试运行以下代码以添加有颜色的边框。

实时演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         .button {
            background-color: yellow;
            color: black;
            text-align: center;
            font-size: 15px;
            padding: 20px;
            border-radius: 15px;
            border: 3px dashed blue;
         }
      </style>
   </head>
   <body>
      <h2>Result</h2>
      <p>Click below for result:</p>
      <button class = "button">Result</button>
   </body>
</html>

以上就是如何使用 CSS 为按钮添加彩色边框?的详细内容,更多请关注IT视界其它相关文章!



热门