Web速查-索引

Alt text

定义

border-top-color 设置元素的上边框的颜色。

注意:只能定义纯色,而且只有当边框的样式是一个非 none 或 hidden 的值时边框才可能出现。

语法

border-top-color:transparent|color_name|hex_number|rgb_number|inherit;

属性值

描述
transparent 默认值。边框颜色为透明。
color_name 规定颜色值为颜色名称的边框颜色(比如 red)。
hex_number 规定颜色值为十六进制值的边框颜色(比如 #ff0000)。
rgb_number 规定颜色值为 rgb 代码的边框颜色(比如 rgb(255,0,0)
inherit 规定应该从父元素继承边框颜色。

实例

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>鱼C-零基础入门学习Web(Html5+Css3)</title>
<style type="text/css">
p
{
width: 111px;
border-style: solid;
border-top-color: green;
}
</style>
</head>
<body>
<p>鱼C工作室</p>
</body>
</html>

鱼C工作室

浏览器支持

表格中的数字表示支持该属性的第一个浏览器版本号

Safari Chrome FireFox IE
6.0 3.0 4.0 9.0