border-block-end-color
border-block-end-color CSS 属性定义了一个元素的逻辑块结束边框的颜色。该颜色映射到物理边框颜色取决于元素的书写模式、方向性和文本方向。它对应于 border-top-color、border-right-color、border-bottom-color 或 border-left-color 属性,具体取决于为 writing-mode、direction 和 text-orientation 定义的值。
试一试
border-block-end-color: red;
writing-mode: horizontal-tb;
border-block-end-color: #32a1ce;
writing-mode: vertical-rl;
border-block-end-color: rgb(170 50 220 / 0.6);
writing-mode: horizontal-tb;
border-block-end-color: hsl(60 90% 50% / 0.8);
writing-mode: vertical-lr;
<section class="default-example" id="default-example">
<div class="transition-all" id="example-element">
This is a box with a border around it.
</div>
</section>
#example-element {
background-color: #eeeeee;
color: black;
border: 0.75em solid;
padding: 0.75em;
width: 80%;
height: 100px;
unicode-bidi: bidi-override;
}
语法
css
border-block-end-color: yellow;
border-block-end-color: #f5f6f7;
/* Global values */
border-block-end-color: inherit;
border-block-end-color: initial;
border-block-end-color: revert;
border-block-end-color: revert-layer;
border-block-end-color: unset;
相关属性包括 border-block-start-color、border-inline-start-color 和 border-inline-end-color,它们定义了元素的其他边框颜色。
值
<color>-
边框的颜色。
正式定义
正式语法
border-block-end-color =
<color> |
<image-1D>
<image-1D> =
<stripes()>
<stripes()> =
stripes( <color-stripe># )
<color-stripe> =
<color> &&
[ <length-percentage> | <flex> ]?
<length-percentage> =
<length> |
<percentage>
示例
垂直文本的边框颜色
HTML
html
<div>
<p class="exampleText">Example text</p>
</div>
CSS
css
div {
background-color: yellow;
width: 120px;
height: 120px;
}
.exampleText {
writing-mode: vertical-lr;
border: 10px solid blue;
border-block-end-color: red;
}
结果
规范
| 规范 |
|---|
| CSS 逻辑属性和值第 1 级 # border-color |
浏览器兼容性
加载中…