- 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 - 最大块级尺寸
- 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-inline 属性
CSS border-inline 是一个简写属性,它在一个声明中设置不同的逻辑内联边框属性的值,例如 border-inline-width、border-inline-style 和 border-inline-color。border-style 是必需的。如果未指定,则将使用颜色的默认值和宽度。此属性受书写模式、文本方向和方向的影响。
语法
border-inline: border-inline-width border-inline-style border-inline-color | initial | inherit;
属性值
| 值 | 描述 |
|---|---|
| border-inline-width | 它指定元素在内联方向上的边框宽度。默认值为 medium。 |
| border-inline-style | 它指定元素在内联方向上的边框样式。默认值为 none。 |
| border-inline-color | 它指定元素在内联方向上的边框颜色。默认值为文本颜色。 |
| initial | 它将属性设置为其默认值。 |
| inherit | 它从父元素继承属性。 |
CSS 内联边框属性示例
以下示例解释了使用不同值的 border-inline 属性。
定义内联边框属性的所有值
为了在一个声明中定义 border-inline-width、border-inline-style 和 border-inline-color 的值,我们使用 border-inline 属性。以下示例演示了如何操作。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.container {
background-color: lightgrey;
width: 100vh;
height: 400px;
display: block;
justify-content: center;
padding: 25px;
text-align: center;
font-weight:bold;
}
.borders {
border: 1px solid black;
padding: 20px;
}
.border1 {
border-inline: 4px solid red;
}
.border2 {
border-inline: 6px dashed blue;
}
.border3 {
border-inline: 8px dotted yellow;
}
.border4 {
border-inline: 8px double brown;
}
</style>
</head>
<body>
<h2>
CSS border-inline property
</h2>
<div class="container">
<p class="borders border1">
This has border-inline property with
4px width solid style and red color
</p>
<p class="borders border2">
This has border-inline property with
6px width dashed style and blue color
</p>
<p class="borders border3">
This has border-inline property with
8px width dotted style and yellow color
</p>
<p class="borders border4 ">
This has border-inline property with
8px width double style and brown color
</p>
</div>
</body>
</html>
内联边框属性的组成属性
border-inline 属性由属性 border-inline-width、border-inline-style 和 border-inline-color 组成。以下示例演示了这些单个属性如何组合以显示 border-inline 效果。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.container {
background-color: lightgreen;
width: 100vh;
height: 200px;
display: block;
justify-content: center;
padding: 25px;
text-align: center;
font-weight: bold;
}
.borders {
border: 1px solid black;
padding: 20px;
}
.border1 {
border-inline-width: 4px;
border-inline-style: solid;
border-inline-color: red;
}
.border2 {
border-inline-width: 6px;
border-inline-style: dashed;
border-inline-color: blue;
}
</style>
</head>
<body>
<h2>
CSS border-inline property
</h2>
<div class="container">
<p class="borders border1">
This has border-inline-width:4px,
border-inline-style:solid,
border-inline-color:red
</p>
<p class="borders border2">
This has border-inline-width:6px,
border-inline-style:dashed,
border-inline-color:blue
</p>
</div>
</body>
</html>
带有书写模式的内联边框属性
border-inline 属性受书写模式的影响,书写模式决定内联边框的方向。在垂直书写模式下,它影响顶部和底部边框;在水平书写模式下,它影响左侧和右侧边框。以下示例中显示了这些内容。
示例
<!DOCTYPE html>
<html>
<head>
<style>
.container {
display: block;
justify-content: center;
padding: 25px;
text-align: center;
font-weight: bold;
}
.borders {
border: 1px solid black;
padding: 20px;
}
.border1 {
border-inline: 4px solid red;
writing-mode: horizontal-rl;
}
.border2 {
border-inline: 6px dashed blue;
writing-mode: vertical-rl;
}
</style>
</head>
<body>
<h2>
CSS border-inline property
</h2>
<div class="container">
<p class="borders border1">
This has border-inline 4px width,
solid style, red color and
horizontal writing mode.
</p>
<p class="borders border2">
This has border-inline 6px width,
dashed style, blue color and
vertical writing mode.
</p>
</div>
</body>
</html>
支持的浏览器
| 属性 | ![]() |
![]() |
![]() |
![]() |
![]() |
|---|---|---|---|---|---|
| border-inline | 87.0 | 87.0 | 66.0 | 14.1 | 73.0 |
css_properties_reference.htm
广告




