border-block-end

Experimental: 这是一个实验中的功能
此功能某些浏览器尚在开发中,请参考浏览器兼容性表格以得到在不同浏览器中适合使用的前缀。由于该功能对应的标准文档可能被重新修订,所以在未来版本的浏览器中该功能的语法和行为可能随之改变。

border-block-end 属性是一个简写属性,用于在样式表中的单个位置设置各个逻辑块结尾边界属性值。

尝试一下

Syntax

border-block-end: 1px;
border-block-end: 2px dotted;
border-block-end: medium dashed blue;

border-block-end can be used to set the values for one or more of border-block-end-width (en-US), border-block-end-style (en-US), and border-block-end-color (en-US). The physical border to which it maps depends on the element's writing mode, directionality, and text orientation. It corresponds to the border-top, border-right, border-bottom, or border-left property depending on the values defined for writing-mode, direction, and text-orientation.

Related properties are border-block-start (en-US), border-inline-start (en-US), and border-inline-end (en-US), which define the other borders of the element.

初始值as each of the properties of the shorthand:
适用元素all elements
是否是继承属性
计算值as each of the properties of the shorthand:
Animation typeas each of the properties of the shorthand:

Values

The border-block-end is specified with one or more of the following, in any order:

<'border-width'>

The width of the border. See border-width.

<'border-style'>

The line style of the border. See border-style.

<'color'>

The color of the border. See color.

Formal syntax

border-block-end = 
<'border-top-width'> ||
<'border-top-style'> ||
<color>

Example

HTML Content

<div>
  <p class="exampleText">Example text</p>
</div>

CSS Content

div {
  background-color: yellow;
  width: 120px;
  height: 120px;
}

.exampleText {
  writing-mode: vertical-rl;
  border-block-end: 5px dashed blue;
}

Specification

Specification
CSS Logical Properties and Values Level 1
# border-shorthands

Browser compatibility

BCD tables only load in the browser

See also