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

WBOY
WBOY 转载
2023-08-27 10:17:02 296浏览

如何使用 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 为按钮添加彩色边框?的详细内容,更多请关注php中文网其它相关文章!

声明:本文转载于:tutorialspoint,如有侵犯,请联系admin@php.cn删除