css border-right-color属性怎么用


本文摘自PHP中文网,作者silencement,侵删。

1

css border-right-color属性定义及用法

在css中,border-right-color属性是用来设置一个元素的右边框的颜色。当我们需要改变元素右边框的颜色的时候,可以使用border-right-color属性来设置。在使用border-right-color属性定义边框演示之前必须先定义边框(即定义border-right-style 属性),不然没有边框就定义边框颜色是没有效果的。

1

css border-right-color属性语法格式

css语法:border-right-color:color_name / hex_number / rgb_number / transparent / inherit

例:border-right-color:red; border-right-color:#ff0000; border-right-color:rgb(255,0,0)

JavaScript 语法: object.style.borderRightColor="blue"

1

css border-right-color属性值说明

color_name:边框颜色为颜色名称表示的颜色(如red)

hex_number:边框颜色为十六进制值表示的颜色(如 #ff0000)

rgb_number:边框颜色为rgb 代码表示的颜色(如 rgb(255,0,0))

transparent:边框颜色为透明(默认)

Inherit:从父元素继承边框颜色

实例

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8" />

<title>css border-right-color右边框颜色属性笔记</title>

<style type="text/css">

body{background: #ddd;font-size:20px;}

#a,#b,#c,#d{border:2px solid #000;margin-top:10px;width:300px;}

#a{border-right-color:red;}

#b{border-right-color:#FF9999;}

#c{border-right-color:rgb(138,43,226);}

</style>

</head>

<body>

<div id = "a">border-right-color:red; 颜色名称表示的颜色演示</div>

<div id = "b">border-right-color:#FF9999; 十六进制值表示的颜色演示</div>

<div id = "c">border-right-color:rgb(138,43,226); rgb代码</div>

</body>

</html>

运行结果

bcfda60e89797e92d8a3e02e7e3a921.png

以上就是css border-right-color属性怎么用的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

css如何实现客服悬浮效果

浅谈css元素显示模式

css布局之布局模型

css outline-offset属性怎么用

css怎么设置图片圆角

jq如何判断css是否存在

css columns属性怎么用

css中绝对定位什么意思

css文本行高怎么设置

html中表格tr的td单元格怎么设置宽度属性

更多相关阅读请进入《css》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...