Movatterモバイル変換


[0]ホーム

URL:


  1. 面向开发者的 Web 技术
  2. CSS:层叠样式表
  3. CSS 参考
  4. Properties
  5. border-block-end

此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in EnglishAlways switch to English

border-block-end

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2020年1月⁩.

CSS 属性border-block-end简写属性,用于在样式表中的某处同时设置逻辑块末边框的各属性值。

尝试一下

border-block-end: solid;writing-mode: horizontal-tb;
border-block-end: dashed red;writing-mode: vertical-rl;
border-block-end: 1rem solid;writing-mode: horizontal-tb;
border-block-end: thick double #32a1ce;writing-mode: vertical-lr;
<section>  <div>    This is a box with a border around it.  </div></section>
#example-element {  background-color: #eee;  color: #8b008b;  padding: 0.75em;  width: 80%;  height: 100px;  unicode-bidi: bidi-override;}

属性构成

此属性为下列 CSS 属性的简写属性:

语法

css
border-block-end: 1px;border-block-end: 2px dotted;border-block-end: medium dashed blue;/* 全局值 */border-block-end: inherit;border-block-end: initial;border-block-end: revert;border-block-end: revert-layer;border-block-end: unset;

border-block-end 可用于设置border-block-end-widthborder-block-end-styleborder-block-end-color 中至少一个属性的值。此属性所对应的实体边框取决于元素的书写模式、行内方向和文本朝向。根据writing-modedirectiontext-orientation 所定义的值,此属性对应于border-topborder-rightborder-bottomborder-left 属性。

与此相关的属性有border-block-startborder-inline-startborder-inline-end,这些属性定义了元素的其他边框。

取值

border-block-end 属性可用下列值中的至少一个指定,次序任意:

<'border-width'>

边框宽度。见border-width

<'border-style'>

边框线型。见border-style

<'color'>

边框颜色。见color

形式定义

初始值该简写所对应的每个属性:
适用元素所有元素
是否是继承属性
计算值该简写所对应的每个属性:
动画类型该简写所对应的每个属性:

形式语法

border-block-end =
<line-width>||
<line-style>||
<color>

<line-width> =
<length [0,∞]>|
thin|
medium|
thick

<line-style> =
none|
hidden|
dotted|
dashed|
solid|
double|
groove|
ridge|
inset|
outset

示例

竖排文本的边框

HTML

html
<div>  <p>示例文本</p></div>

CSS

css
div {  background-color: yellow;  width: 120px;  height: 120px;}.exampleText {  writing-mode: vertical-rl;  border-block-end: 5px dashed blue;}

结果

规范

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

浏览器兼容性

参见

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp