使用 CSS 在一个声明中设置所有顶部边框属性

cssweb developmentfront end technology更新于 2025/6/5 11:56:17

使用 CSS 中的 border-top 属性在一个声明中设置所有顶部边框属性。

示例

您可以尝试运行以下代码来实现 border-top 属性 −

<!DOCTYPE html>
<html>
   <head>
      <style>
         p {
            border-style: solid;
            border-top: thick dashed #FFFF00;
         }
      </style>
   </head>
   <body>
      <p>This is demo text</p>
   </body>
</html>

相关文章


有用资源