
- CSS 教程
- CSS - 首页
- CSS - 路线图
- CSS - 简介
- CSS - 语法
- CSS - 选择器
- CSS - 包含
- CSS - 度量单位
- CSS - 颜色
- CSS - 背景
- CSS - 字体
- CSS - 文本
- CSS - 图片
- CSS - 链接
- CSS - 表格
- CSS - 边框
- CSS - 块级边框
- CSS - 内联边框
- CSS - 外边距
- CSS - 列表
- CSS - 内边距
- CSS - 光标
- CSS - 轮廓
- CSS - 尺寸
- CSS - 滚动条
- CSS - 块内元素
- CSS - 下拉菜单
- CSS - 可见性
- CSS - 溢出
- CSS - 清除浮动
- CSS - 浮动
- CSS - 箭头
- CSS - 调整大小
- CSS - 引号
- CSS - 顺序
- CSS - 定位
- CSS - 连字符
- CSS - 悬停
- CSS - 显示
- CSS - 聚焦
- CSS - 缩放
- CSS - 位移
- CSS - 高度
- CSS - 连字符字符
- CSS - 宽度
- CSS - 不透明度
- CSS - Z-Index
- CSS - 底部
- CSS - 导航栏
- CSS - 覆盖层
- CSS - 表单
- CSS - 对齐
- CSS - 图标
- CSS - 图片库
- CSS - 注释
- CSS - 加载器
- CSS - 属性选择器
- CSS - 组合器
- CSS - 根元素
- CSS - 盒模型
- CSS - 计数器
- CSS - 剪裁
- CSS - 书写模式
- CSS - Unicode-bidi
- CSS - min-content
- CSS - 全部
- CSS - 内嵌
- CSS - 隔离
- CSS - 溢出滚动
- CSS - Justify Items
- CSS - Justify Self
- CSS - 制表符大小
- CSS - 指针事件
- CSS - Place Content
- CSS - Place Items
- CSS - Place Self
- CSS - 最大块级尺寸
- CSS - 最小块级尺寸
- CSS - 混合模式
- CSS - 最大内联尺寸
- CSS - 最小内联尺寸
- CSS - 偏移量
- CSS - 强调色
- CSS - 用户选择
- CSS 高级
- CSS - 网格
- CSS - 网格布局
- CSS - Flexbox
- CSS - 可见性
- CSS - 定位
- CSS - 层
- CSS - 伪类
- CSS - 伪元素
- CSS - @规则
- CSS - 文本效果
- CSS - 分页媒体
- CSS - 打印
- CSS - 布局
- CSS - 验证
- CSS - 图片精灵
- CSS - !important
- CSS - 数据类型
- CSS3 教程
- CSS3 - 教程
- CSS - 圆角
- CSS - 边框图片
- CSS - 多重背景
- CSS - 颜色
- CSS - 渐变
- CSS - 盒阴影
- CSS - 盒装饰中断
- CSS - 光标颜色
- CSS - 文本阴影
- CSS - 文本
- CSS - 2D 变换
- CSS - 3D 变换
- CSS - 过渡
- CSS - 动画
- CSS - 多列
- CSS - 盒大小
- CSS - 工具提示
- CSS - 按钮
- CSS - 分页
- CSS - 变量
- CSS - 媒体查询
- CSS - 函数
- CSS - 数学函数
- CSS - 遮罩
- CSS - 形状
- CSS - 样式图片
- CSS - 特异性
- CSS - 自定义属性
- CSS 响应式
- CSS RWD - 简介
- CSS RWD - 视口
- CSS RWD - 网格视图
- CSS RWD - 媒体查询
- CSS RWD - 图片
- CSS RWD - 视频
- CSS RWD - 框架
- CSS 工具
- CSS - PX 到 EM 转换器
- CSS - 颜色选择器和动画
- CSS 资源
- CSS - 有用资源
- CSS - 讨论
CSS - border-right 属性
CSS border-right 属性是用于定义 border-right-width,border-right-style 和 border-right-color 属性值的简写形式。 border-right-style 属性是必需的。如果未指定颜色和宽度,则将使用默认值。
语法
border-right: border-width border-style border-color | initial | inherit;
属性值
值 | 描述 |
---|---|
border-right-width | 指定元素右边框的宽度。可选。默认值为 medium。 |
border-right-style | 指定元素右边框的样式。必需。默认值为 none。 |
border-right-color | 指定元素右边框的颜色。可选。默认值为文本颜色。 |
initial | 将属性设置为其默认值。 |
inherit | 从父元素继承属性。 |
Explore our latest online courses and learn new skills at your own pace. Enroll and become a certified expert to boost your career.
CSS 右边框属性示例
以下示例说明了使用不同值的 border-right 属性。
定义右边框属性的所有值
要在一个声明中定义 border-right-width、border-right-style 和 border-right-color 的值,我们使用 border-right 属性。该属性需要三个值,第一个值用于宽度,第二个值用于样式,第三个值用于颜色。以下示例演示了如何执行此操作。
示例
<!DOCTYPE html> <html> <head> <style> .properties { text-align: center; padding: 20px; } .example1 { background-color: lightgreen; border-right: blue 15px solid; } .example2 { border: 2px solid black; border-right: 5px dashed red; } </style> </head> <body> <h2> CSS border-right property </h2> <h4 class="properties example1"> This shows a blue right border for a 'h4' tag </h4> <p class=" properties example2"> This shows a 'red' right border </p> </body> </html>
右边框属性的组成属性
border-right 属性是 border-right-width、border-right-style 和 border-right-color 属性的组合。以下示例演示了如何组合使用这些属性来显示 border-right 属性的效果。
示例
<!DOCTYPE html> <html> <head> <style> .properties { text-align: center; padding: 20px; } .example1 { background-color: lightgray; border-right-width: 15px; border-right-style: solid; border-right-color: green; } .example2 { border: 2px solid black; border-right-width: 25px; border-right-style: solid; border-right-color: brown; } </style> </head> <body> <h2> CSS border-right property </h2> <h4 class="properties example1"> This shows a green right border for a 'h4' tag </h4> <p class=" properties example2"> This shows a 'brown' right border </p> </body> </html>
支持的浏览器
属性 | ![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|
border-right | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
css_properties_reference.htm
广告