网络学院 w3pop社区 网络资源 IT新闻

w3pop.com :: 网络学院 :: CSS :: CSS border-color属性

会员登陆

帐号

密码

回答

记住密码

忘记密码? 注册

CSS border-color属性


作者:w3pop.com 翻译/整理:w3pop.com 发布:2007-04-28 浏览:2260 :: ::

The border-color property sets the color of the four borders. This property can take one to four colors.
border-color 属性可设置四条边的颜色,这个属性可以有1个到4个颜色

Note: Always declare the border-style property before the border-color property. An element must have borders before you change the color of them.
注意:请在border-color前先声明border-style属性。元素必须在改变边框颜色前先有它们(先有边框后有边框色)

继承性:

举例

table {border-color: red}
all four borders will be red
四边框颜色全为红色

table {border-color: red green}
top and bottom border will be red, left and right border will be green 
上下边框颜色为红色,左右边框颜色为绿色

table {border-color: red green blue}
top border will be red, left and right border will be green, bottom border will be blue
上边框颜色为红色,左右边框颜色为绿色,下边框颜色为蓝色

table {border-color: red green blue yellow}
top border will be red, right border will be green, bottom border  will be blue, left border will be yellow
上边框颜色为红色,右边框为绿色,下边框颜色为蓝色,左边框色为黄色

可用值

描述
color The color value can be a color name (red), a rgb value (rgb(255,0,0)), or a hex number (#FF0000). 
color值可以是颜色名称,或是rgb值(rgb(255,0,0)),或是十六进制数(#F00)
transparent The border is transparent
边框色为透明

评论 (0) All