- 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 - Tab Size
- CSS - 指针事件
- CSS - Place Content
- CSS - Place Items
- CSS - Place Self
- CSS - Max Block Size
- CSS - Min Block Size
- CSS - Mix Blend Mode
- CSS - Max Inline Size
- CSS - Min Inline Size
- CSS - Offset
- CSS - Accent Color
- CSS - User Select
- 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 - Caret Color
- 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-style 属性
CSS border-right-style 属性设置元素右侧边框的样式。
语法
border-right-style: none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset | initial | inherit;
属性值
| 值 | 描述 |
|---|---|
| none | 指定没有边框。默认值。 |
| hidden | 类似于 none,但用于表格元素的边框冲突解决。 |
| dotted | 指定点状边框。 |
| dashed | 指定虚线边框。 |
| solid | 指定实线边框。 |
| double | 指定双线边框。 |
| groove | 指定 3D 凹槽边框。效果取决于 border-color 值。 |
| ridge | 指定 3D 脊状边框。效果取决于 border-color 值。 |
| inset | 指定 3D 内嵌边框。效果取决于 border-color 值。 |
| outset | 指定 3D 外凸边框。效果取决于 border-color 值。 |
| initial | 将属性设置为默认值。 |
| inherit | 从父元素继承该属性。 |
CSS 右边框样式属性示例
以下示例说明了使用不同值的 border-right-style 属性。
无右边框样式
要没有右边框,我们使用 none 值。在以下示例中,使用了 none 值。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-none {
border-right-style: none;
text-align: center;
padding: 15px;
margin: 8px;
}
h1 {
background-color: lightgreen;
}
p {
border: 6px solid silver;
}
</style>
</head>
<body>
<h2>
CSS border-right-style property
</h2>
<div>
<h1 class="border-none">
This heading has 'none' right border style
</h1>
<p class="border-none">
This border has 'none' right border style
</p>
</div>
</body>
</html>
透明右边框样式
要有一个存在的但不可见的边框,我们可以使用 transparent 值。transparent 值创建不可见边框,而 none 值则创建无边框。以下示例展示了这种区别。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.borders {
padding: 15px;
margin: 8px;
text-align: center;
}
.border1 {
border: 8px solid silver;
border-right-style: none;
}
.border2 {
border: 8px solid silver;
border-right-color: gold;
border-right-style: transparent;
}
</style>
</head>
<body>
<h2>
CSS border-right-style property
</h2>
<div>
<p class="borders border1">
This border is using none value,
so it does not have right border
indicated by the gap.
</p>
<p class="borders border2">
This border is using transparent value,
so it has an invisible border. Since the border
exist, the border color is applied to it
indicated by the gold color.
</p>
</div>
</body>
</html>
点状右边框样式
要拥有点状右边框,我们使用 dotted 值。在以下示例中,dotted 值与 border-right-style 属性一起使用。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-none {
border-right-style: dotted;
border-right-color:black;
border-right-width:6px;
text-align: center;
padding: 15px;
margin: 8px;
}
h1 {
background-color: lightgreen;
}
p {
border: 6px solid silver;
}
</style>
</head>
<body>
<h2>
CSS border-right-style property
</h2>
<div>
<h1 class="border-none">
This heading has 'dotted' right border style
</h1>
<p class="border-none">
This border has 'dotted' right border style
</p>
</div>
</body>
</html>
虚线右边框样式
要拥有虚线右边框,我们使用 dashed 值。在以下示例中,dashed 值与 border-right-style 属性一起使用。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-none {
border-right-style: dashed;
border-right-color:black;
border-right-width:6px;
text-align: center;
padding: 15px;
margin: 8px;
}
h1 {
background-color: lightgreen;
}
p {
border: 6px solid silver;
}
</style>
</head>
<body>
<h2>
CSS border-right-style property
</h2>
<div>
<h1 class="border-none">
This heading has 'dashed' right border style
</h1>
<p class="border-none">
This border has 'dashed' right border style
</p>
</div>
</body>
</html>
实线右边框样式
要拥有实线右边框,我们使用 solid 值。在以下示例中,solid 值与 border-right-style 属性一起使用。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-none {
border-right-style: solid;
border-right-color:black;
border-right-width:6px;
text-align: center;
padding: 15px;
margin: 8px;
}
h1 {
background-color: lightgreen;
}
p {
border: 6px solid silver;
}
</style>
</head>
<body>
<h2>
CSS border-right-style property
</h2>
<div>
<h1 class="border-none">
This heading has 'solid' right border style
</h1>
<p class="border-none">
This border has 'solid' right border style
</p>
</div>
</body>
</html>
双线右边框样式
要拥有双线右边框,我们使用 double 值。在以下示例中,double 值与 border-right-style 属性一起使用。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-none {
border-right-style: double;
border-right-color:black;
border-right-width:6px;
text-align: center;
padding: 15px;
margin: 8px;
}
h1 {
background-color: lightgreen;
}
p {
border: 6px solid silver;
}
</style>
</head>
<body>
<h2>
CSS border-right-style property
</h2>
<div>
<h1 class="border-none">
This heading has 'double' right border style
</h1>
<p class="border-none">
This border has 'double' right border style
</p>
</div>
</body>
</html>
凹槽右边框样式
要拥有凹槽右边框,我们使用 groove 值。在以下示例中,groove 值与 border-right-style 属性一起使用。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-none {
border-right-style: groove;
border-right-color:black;
border-right-width:6px;
text-align: center;
padding: 15px;
margin: 8px;
}
h1 {
background-color: lightgreen;
}
p {
border: 6px solid silver;
}
</style>
</head>
<body>
<h2>
CSS border-right-style property
</h2>
<div>
<h1 class="border-none">
This heading has 'groove' right border style
</h1>
<p class="border-none">
This border has 'groove' right border style
</p>
</div>
</body>
</html>
脊状右边框样式
要拥有脊状右边框,我们使用 ridge 值。在以下示例中,ridge 值与 border-right-style 属性一起使用。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-none {
border-right-style: ridge;
border-right-color:black;
border-right-width:6px;
text-align: center;
padding: 15px;
margin: 8px;
}
h1 {
background-color: lightgreen;
}
p {
border: 6px solid silver;
}
</style>
</head>
<body>
<h2>
CSS border-right-style property
</h2>
<div>
<h1 class="border-none">
This heading has 'ridge' right border style
</h1>
<p class="border-none">
This border has 'ridge' right border style
</p>
</div>
</body>
</html>
内嵌右边框样式
要拥有内嵌右边框,我们使用 inset 值。在以下示例中,inset 值与 border-right-style 属性一起使用。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-none {
border-right-style: inset;
border-right-color:black;
border-right-width:6px;
text-align: center;
padding: 15px;
margin: 8px;
}
h1 {
background-color: lightgreen;
}
p {
border: 6px solid silver;
}
</style>
</head>
<body>
<h2>
CSS border-right-style property
</h2>
<div>
<h1 class="border-none">
This heading has 'inset' right border style
</h1>
<p class="border-none">
This border has 'inset' right border style
</p>
</div>
</body>
</html>
外凸右边框样式
要拥有外凸右边框,我们使用 outset 值。在以下示例中,outset 值与 border-right-style 属性一起使用。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-none {
border-right-style: outset;
border-right-color:black;
border-right-width:6px;
text-align: center;
padding: 15px;
margin: 8px;
}
h1 {
background-color: lightgreen;
}
p {
border: 6px solid silver;
}
</style>
</head>
<body>
<h2>
CSS border-right-style property
</h2>
<div>
<h1 class="border-none">
This heading has 'outset' right border style
</h1>
<p class="border-none">
This border has 'outset' right border style
</p>
</div>
</body>
</html>
支持的浏览器
| 属性 | ![]() |
![]() |
![]() |
![]() |
![]() |
|---|---|---|---|---|---|
| border-right-style | 1.0 | 4.0 | 1.0 | 1.0 | 3.5 |
css_properties_reference.htm
广告




