多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
**border-top-color** * 描述:设置对象上边框的颜色。 * 版本:CSS1 * 继承性:无 **语法** ``` border-top-color: 颜色; ``` 颜色种类 * transparent:默认。背景颜色为透明。 * color name:设置颜色值为颜色名称的背景颜色,比如:red。 * hex number:设置颜色值为十六进制值的背景颜色,比如:#ffff00。 * rgb number:设置颜色值为 rgb 代码的背景颜色,比如:rgb(255,255,0)。 * inherit:继承父元素 background-color 属性的设置。 **使用说明** 该属性仅对上边框的颜色进行设置。 当 border-width 等于 0 或 border-style 为 none,本属性将被忽略。 **代码示例** ``` <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>border-top-color</title> <style> #container{ width: 50px; height: 50px; border: solid #000000; border-top-color: red; } </style> </head> <body> <div id="container"> </div> </body> </html> ``` ![border-top-color](https://box.kancloud.cn/7dfce2194cfcc50b166fe7fe1dfdad4b_67x66.png)