border-block-start
試一試
border-block-start: solid;
writing-mode: horizontal-tb;
border-block-start: dashed red;
writing-mode: vertical-rl;
border-block-start: 1rem solid;
writing-mode: horizontal-tb;
border-block-start: thick double #32a1ce;
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: darkmagenta;
padding: 0.75em;
width: 80%;
height: 100px;
unicode-bidi: bidi-override;
}
構成屬性
此屬性是以下 CSS 屬性的簡寫:
語法
css
border-block-start: 1px;
border-block-start: 2px dotted;
border-block-start: medium dashed blue;
/* Global values */
border-block-start: inherit;
border-block-start: initial;
border-block-start: revert;
border-block-start: revert-layer;
border-block-start: unset;
border-block-start 可用於設定 border-block-start-width、border-block-start-style 和 border-block-start-color 中的一個或多個值。它對映到的物理邊框取決於元素的書寫模式、方向性和文字方向。它對應於 border-top、border-right、border-bottom 或 border-left 屬性,具體取決於為 writing-mode、direction 和 text-orientation 定義的值。
相關屬性是 border-block-end、border-inline-start 和 border-inline-end,它們定義了元素的其他邊框。
值
border-block-start 按以下一項或多項指定,順序不限
<'border-width'>-
邊框的寬度。請參閱
border-width。 <'border-style'>-
邊框的線條樣式。請參閱
border-style。 <color>-
邊框的顏色。
正式定義
| 初始值 | 作為簡寫中的每個屬性
|
|---|---|
| 應用於 | 所有元素 |
| 繼承性 | 否 |
| 計算值 | 作為簡寫中的每個屬性
|
| 動畫型別 | 作為簡寫中的每個屬性
|
正式語法
border-block-start =
<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 class="exampleText">Example text</p>
</div>
CSS
css
div {
background-color: yellow;
width: 120px;
height: 120px;
}
.exampleText {
writing-mode: vertical-rl;
border-block-start: 5px dashed blue;
}
規範
| 規範 |
|---|
| CSS 邏輯屬性和值第 1 級 # 邊框簡寫 |
瀏覽器相容性
載入中…
另見
- CSS 邏輯屬性與值
- 此屬性對映到以下物理邊框屬性之一:
border-top、border-right、border-bottom或border-left。 writing-mode、direction、text-orientation