企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## border-top 属性 ### 属性定义及使用说明 border-top 简写属性把上边框的所有属性设置到一个声明中 可以按顺序设置如下属性: border-top-width, border-top-style, and border-top-color. 如果不设置其中的某个值,也不会出问题,比如 border-top:solid #ff0000; 也是允许的。 JavaScript 语法:object.style.borderTop="3px solid blue" * * * ## 浏览器支持 表格中的数字表示支持该属性的第一个浏览器版本号。 | 属性 |   |   |   |   |   | | --- | --- | --- | --- | --- | --- | | border-top | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 | * * * ## 属性值 | 值 | 描述 | | --- | --- | | *border-top-width* | 规定上边框的宽度。参阅:[border-top-width](https://www.w3cschool.cn/cssref/pr-border-top-width.html "CSS border-top-width 属性") 中可能的值。 | | *border-top-style* | 规定上边框的样式。参阅:[border-top-style](https://www.w3cschool.cn/cssref/pr-border-top-style.html "CSS border-top-style 属性") 中可能的值。 | | *border-top-color* | 规定上边框的颜色。参阅:[border-top-color](https://www.w3cschool.cn/cssref/pr-border-top-color.html "CSS border-top-color 属性") 中可能的值。 | | inherit | 规定应该从父元素继承 border-top 属性的设置。 | * * * ## 实例--设置上边框的样式: ``` <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>W3Cschool教程(w3cschool.cn)</title> <style> p { border: medium double rgb(250,0,255) } </style> </head> <body> <p>This is some text in a paragraph.</p> </body> </html> ```