- 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 轴索引
- 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 - 对齐项目
- CSS - 自我对齐
- CSS - 制表符大小
- CSS - 指针事件
- CSS - 放置内容
- CSS - 放置项目
- CSS - 自我放置
- 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 - 问题与解答
- CSS - 快速指南
- CSS - 参考文献
- CSS - 颜色参考文献
- CSS - 网络浏览器参考文献
- CSS - 网络安全字体
- CSS - 单位
- CSS - 动画
- CSS 工具
- CSS - PX 到 EM 转换器
- CSS - 颜色选择器和动画
- CSS 资源
- CSS - 有用资源
- CSS - 讨论
CSS - border-inline-style 属性
CSS border-inline-style 属性决定元素的逻辑内联边框应该如何显示,将该样式根据元素的书写模式、方向和文本方向转换为物理边框样式。
语法
border-inline-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-inline-style 属性。
无内联边框样式
为了没有任何内联边框,我们使用 none 值。在以下示例中,使用了 none 值。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-none {
border-inline-style: none;
}
p {
padding: 15px;
border: 6px solid gold;
margin: 8px;
text-align: center;
}
</style>
</head>
<body>
<h2>
CSS border-inline-style property
</h2>
<div>
<p class="border-none">
none inline border
</p>
</div>
</body>
</html>
透明内联边框样式
为了显示存在但不可见的边框,我们可以使用透明值。透明值会创建不可见的边框,而 none 则不会创建边框。此区别在以下示例中显示。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.borders {
padding: 15px;
margin: 8px;
text-align: center;
}
.border1 {
border: 8px solid gold;
border-inline-style: none;
}
.border2 {
border: 8px solid gold;
border-inline-color: grey;
border-inline-style: transparent;
}
</style>
</head>
<body>
<h2>
CSS border-inline-style property
</h2>
<div>
<p class="borders border1">
This border is using none value,
so it does not have inline borders
indicated by the gap.
</p>
<p class="borders border2">
This border is using transparent value,
so it has invisible borders. Since borders
exist, the border color is applied to them
indicated by the grey color.
</p>
</div>
</body>
</html>
点状内联边框样式
为了显示点状内联边框,我们使用 dotted 值。在以下示例中,使用了 dotted 值和 border-inline-style 属性。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-dotted {
border-inline-style: dotted;
}
p {
padding: 15px;
border: 6px solid gold;
margin: 8px;
text-align: center;
}
</style>
</head>
<body>
<h2>
CSS border-inline-style property
</h2>
<div>
<p class="border-dotted">
dotted inline borders
</p>
</div>
</body>
</html>
虚线内联边框样式
为了显示虚线内联边框,我们使用 dashed 值。在以下示例中,使用了 dashed 值和 border-inline-style 属性。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-dashed {
border-inline-style: dashed;
}
p {
padding: 15px;
border: 6px solid gold;
margin: 8px;
text-align: center;
}
</style>
</head>
<body>
<h2>
CSS border-inline-style property
</h2>
<div>
<p class="border-dashed">
dashed inline borders
</p>
</div>
</body>
</html>
实线内联边框样式
为了显示实线内联边框,我们使用 solid 值。在以下示例中,使用了 solid 值和 border-inline-style 属性。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-solid {
border-inline-style: solid;
}
p {
padding: 15px;
border: 6px dashed gold;
margin: 8px;
text-align: center;
}
</style>
</head>
<body>
<h2>
CSS border-inline-style property
</h2>
<div>
<p class="border-solid">
solid inline borders
</p>
</div>
</body>
</html>
双线内联边框样式
为了显示双线内联边框,我们使用 double 值。在以下示例中,使用了 double 值和 border-inline-style 属性。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-double {
border-inline-style: double;
}
p {
padding: 15px;
border: 6px solid gold;
margin: 8px;
text-align: center;
}
</style>
</head>
<body>
<h2>
CSS border-inline-style property
</h2>
<div>
<p class="border-double">
double inline borders
</p>
</div>
</body>
</html>
凹槽内联边框样式
若要设置内联边框的凹槽,可以使用 groove 值。在以下示例中,groove 值与 border-inline-style 属性一起使用。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-groove {
border-inline-style: groove;
}
p {
padding: 15px;
border: 6px solid gold;
margin: 8px;
text-align: center;
}
</style>
</head>
<body>
<h2>
CSS border-inline-style property
</h2>
<div>
<p class="border-groove">
groove inline borders
</p>
</div>
</body>
</html>
山脊边框内联样式
若要设置内联边框的山脊,可以使用 ridge 值。在以下示例中,ridge 值与 border-inline-style 属性一起使用。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-ridge {
border-inline-style: ridge;
}
p {
padding: 15px;
border: 6px solid gold;
margin: 8px;
text-align: center;
}
</style>
</head>
<body>
<h2>
CSS border-inline-style property
</h2>
<div>
<p class="border-ridge">
ridge inline borders
</p>
</div>
</body>
</html>
内嵌边框内联样式
若要设置内嵌内联边框,可以使用 inset 值。在以下示例中,inset 值与 border-inline-style 属性一起使用。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-inset {
border-inline-style: inset;
}
p {
padding: 15px;
border: 6px solid gold;
margin: 8px;
text-align: center;
}
</style>
</head>
<body>
<h2>
CSS border-inline-style property
</h2>
<div>
<p class="border-inset">
inset inline borders
</p>
</div>
</body>
</html>
外凸边框内联样式
若要设置外凸内联边框,可以使用 outset 值。在以下示例中,outset 值与 border-inline-style 属性一起使用。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.border-outset {
border-inline-style: outset;
}
p {
padding: 15px;
border: 6px solid gold;
margin: 8px;
text-align: center;
}
</style>
</head>
<body>
<h2>
CSS border-inline-style property
</h2>
<div>
<p class="border-outset">
outset inline borders
</p>
</div>
</body>
</html>
具有多重样式的边框内联样式属性
如果给定的值为单个值,则内联边框的样式可以具有多个值。此值应用于内联起始边框和结尾边框。如果给定的是两个值,则第一个样式应用于内联起始边框,第二个样式应用于内联结尾边框。以下示例中显示了此类情况。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.borders {
padding: 15px;
border: 2px solid gold;
margin: 8px;
border-inline-width: 10px;
border-inline-color: red;
text-align: center;
}
.border1 {
border-inline-style: double;
}
.border2 {
border-inline-style: dashed dotted;
}
.border3 {
border-inline-style: double solid;
}
</style>
</head>
<body>
<h2>
CSS border-inline-style property
</h2>
<div>
<p class="borders border1">
double inline borders- single value
</p>
<p class="borders border2">
double and solid inline borders- multiple values
</p>
<p class="borders border3">
double and solid inline borders- multiple values
</p>
</div>
</body>
</html>
具有书写模式的边框内联样式
border-inline-style 属性受书写模式影响。在垂直书写模式下,它影响 inline-start 和 inline-end 边界(顶部和底部),而在水平书写模式下,它影响相同的边框(左和右)。以下示例对此进行了说明。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.borders {
padding: 15px;
border: 6px solid gold;
margin: 8px;
border-inline-style: dashed dotted;
border-inline-color: red;
text-align: center;
}
.border1 {
writing-mode: horizontal-tb;
}
.border2 {
writing-mode: vertical-rl;
}
</style>
</head>
<body>
<h2>
CSS border-inline-style property
</h2>
<div>
<p class="borders border1">
dashed inline border with
horizontal writing mode
</p>
<p class="borders border2">
dashed inline border with
vertical writing mode.
</p>
</div>
</body>
</html>
具有方向的边框内联样式
border-inline-style 属性受方向的影响,而方向也决定内联边框样式的方向。当具有 rtl(从右到左)值时,影响 inline-end(右边界)样式,而当具有 ltr(从左到右)值时,影响 inline-start(左边界)样式。以下示例中显示了此类情况。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.borders {
padding: 15px;
border: 6px solid gold;
margin: 8px;
text-align: center;
border-inline-style: dashed dotted;
}
.border1 {
direction: rtl;
}
.border2 {
direction: ltr;
}
</style>
</head>
<body>
<h2>
CSS border-inline-style property
</h2>
<div>
<p class="borders border1">
dashed inline border with
(right-to-left) direction.
</p>
<p class="borders border2">
dashed inline border with
(left-to-right) direction.
</p>
</div>
</body>
</html>
受支持的浏览器
| 属性 | ![]() |
![]() |
![]() |
![]() |
![]() |
|---|---|---|---|---|---|
| border-inline-style | 87.0 | 87.0 | 66.0 | 14.1 | 73.0 |




