
- 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 - 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 - 重要
- 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-color 属性
CSS border-inline-color 属性指定元素的逻辑内联边框颜色;元素的书写模式、方向性和文本方向决定实际的边框颜色。
语法
border-inline-color: color | transparent | initial | inherit;
属性值
值 | 描述 |
---|---|
color | 它指定边框的颜色。可以使用不同的颜色格式(名称、rgb 值、十六进制值、hsl 值等)。默认颜色为元素的当前颜色。 |
transparent | 它指定边框必须是透明的。 |
initial | 这将属性设置为其默认值。 |
inherit | 这从父元素继承属性。 |
CSS 内联边框颜色属性示例
以下示例使用不同的值解释了 border-inline-color 属性。
使用颜色名称的内联边框颜色属性
可以使用颜色名称(例如红色、蓝色等)设置内联边框颜色。指定的颜色将应用于边框。在以下示例中,颜色名称已用于边框。
示例
<!DOCTYPE html> <html> <head> <style> .container { background-color: #f2ebc9; padding: 20px; width: 350px; height: 250px; display: block; text-align: center; justify-content: center; } .borders { padding: 12px; border: 4px solid #a6890c; border-inline-style: double; border-inline-width: 10px; } .border1 { border-inline-color: red; } .border2 { border-inline-color: green; } .border3{ border-inline-color: blue purple; } </style> </head> <body> <h2> CSS border-inline-color property </h2> <div class="container"> <p class="borders border1"> This border has 'red' border-inline-color </p> <p class="borders border2"> This border has 'green' border-inline-color </p> <p class="borders border3"> This border has 'blue-purple' border-inline-colors </p> </div> </body> </html>
使用十六进制值的内联边框颜色属性
可以使用十六进制值(例如 #ff0000)设置内联边框颜色。指定的颜色将应用于边框。在以下示例中,十六进制值已用于边框。
示例
<!DOCTYPE html> <html> <head> <style> .container { background-color: #f2ebc9; padding: 20px; width: 350px; height: 250px; display: block; text-align: center; justify-content: center; } .borders { padding: 12px; border: 4px solid #a6890c; border-inline-style: double; border-inline-width: 10px; } .border1 { border-inline-color: #ffaa00; } .border2 { border-inline-color: #ff3333; } .border3{ border-inline-color: #66ff33 #333300; } </style> </head> <body> <h2> CSS border-inline-color property </h2> <div class="container"> <p class="borders border1"> This border has '#ffaa00' value border-inline-color </p> <p class="borders border2"> This border has '#ff3333' value border-inline-color </p> <p class="borders border3"> This border has '#66ff33 #333300' values border-inline-color </p> </div> </body> </html>
使用 RGB 值的内联边框颜色属性
可以使用 rgb 值(例如 rgb(255, 0, 0))设置内联边框颜色。指定的颜色将应用于边框。在以下示例中,rgb 值已用于边框。
示例
<!DOCTYPE html> <html> <head> <style> .container { background-color: #f2ebc9; padding: 20px; width: 350px; height: 250px; display: block; text-align: center; justify-content: center; } .borders { padding: 12px; border: 4px solid #a6890c; border-inline-style: double; border-inline-width: 10px; } .border1 { border-inline-color: rgb(0, 0, 179); } .border2 { border-inline-color: rgb(0, 153, 77); } .border3{ border-inline-color: rgb(153, 102, 255) rgb(255, 153, 0); } </style> </head> <body> <h2> CSS border-inline-color property </h2> <div class="container"> <p class="borders border1"> This border has 'rgb(0, 0, 179)' value border-inline-color </p> <p class="borders border2"> This border has 'rgb(0, 153, 77)' value border-inline-color </p> <p class="borders border3"> This border has 'rgb(153, 102, 255) rgb(255, 153, 0)' values border-inline-color </p> </div> </body> </html>
使用 HSL 值的内联边框颜色属性
可以使用 hsl 值(例如 hsl(0, 100%, 50%))设置内联边框颜色。指定的颜色将应用于边框。在以下示例中,hsl 值已用于边框。
示例
<!DOCTYPE html> <html> <head> <style> .container { background-color: #f2ebc9; padding: 20px; width: 350px; height: 250px; display: block; text-align: center; justify-content: center; } .borders { padding: 12px; border: 4px solid #a6890c; border-inline-style: double; border-inline-width: 10px; } .border1 { border-inline-color: hsl(180, 100%, 15%); } .border2 { border-inline-color: hsl(120, 50%, 40%); } .border3 { border-inline-color: hsl(0, 100%, 55%) hsl(60, 19%, 15%); } </style> </head> <body> <h2> CSS border-inline-color property </h2> <div class="container"> <p class="borders border1"> This border has 'hsl(180, 100%, 15%)' value border-inline-color </p> <p class="borders border2"> This border has 'hsl(120, 50%, 40%)' value border-inline-color </p> <p class="borders border3"> This border has 'hsl(0, 100%, 55%) hsl(60, 19%, 15%)' values border-inline-color </p> </div> </body> </html>
注意:border-inline-color 接受不同数量的值。
- 一个值:如果给出单个值,则它应用于两个内联边框。
- 两个值:如果给出两个值,则第一个颜色应用于第一个边框,第二个颜色应用于第二个边框。
这些已在以上示例中显示。
使用透明值的内联边框颜色属性
要设置透明的内联边框,我们使用透明值。在以下示例中,透明值已用于边框。
示例
<!DOCTYPE html> <html> <head> <style> .container { background-color: #f2ebc9; padding: 20px; width: 350px; height: 200px; display: block; text-align: center; justify-content: center; } .borders { padding: 12px; border: 4px solid #a6890c; border-inline-style: double; border-inline-width: 10px; } .border1 { border-inline-color: transparent; } </style> </head> <body> <h2> CSS border-inline-color property </h2> <div class="container"> <p class="borders border1"> This border has 'transparent' value border-inline-color </p> </div> </body> </html>
支持的浏览器
属性 | ![]() |
![]() |
![]() |
![]() |
![]() |
---|---|---|---|---|---|
border-inline-color | 87.0 | 87.0 | 66.0 | 14.1 | 73.0 |
css_properties_reference.htm
广告