`border-block-start-width` CSS property
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
The **border-block-start-width** CSS property defines the width of the logical block-start border of an element, which maps to a physical border width depending on the element's writing mode, directionality, and text orientation. It corresponds to the {{cssxref("border-top-width")}}, {{cssxref("border-right-width")}}, {{cssxref("border-bottom-width")}}, or {{cssxref("border-left-width")}} property depending on the values defined for {{cssxref("writing-mode")}}, {{cssxref("direction")}}, and {{cssxref("text-orientation")}}.
{{InteractiveExample("CSS Demo: border-block-start-width")}}
border-block-start-width: thick;
writing-mode: horizontal-tb;border-block-start-width: thick;
writing-mode: vertical-rl;border-block-start-width: 4px;
writing-mode: horizontal-tb;border-block-start-width: 4px;
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: palegreen;
color: black;
border: 0 solid crimson;
padding: 0.75em;
width: 80%;
height: 100px;
unicode-bidi: bidi-override;
}Syntax
/* <'line-width'> values */
border-block-start-width: 5px;
border-block-start-width: thick;
/* Global values */
border-block-start-width: inherit;
border-block-start-width: initial;
border-block-start-width: revert;
border-block-start-width: revert-layer;
border-block-start-width: unset;Related properties are {{cssxref("border-block-end-width")}}, {{cssxref("border-inline-start-width")}}, and {{cssxref("border-inline-end-width")}}, which define the other border widths of the element.
Values
- {{cssxref("<line-width>")}}
- : Defines the width of the border, either as an explicit non-negative {{cssxref("<length>")}} or the keywords:
thin,medium, orthick. The default ismedium.
Formal definition
{{CSSInfo}}
Formal syntax
{{csssyntax}}
Examples
Border width with vertical text
HTML
<div>
<p class="exampleText">Example text</p>
</div>CSS
div {
background-color: yellow;
width: 120px;
height: 120px;
}
.exampleText {
writing-mode: vertical-lr;
border: 1px solid blue;
border-block-start-width: 5px;
}Results
{{EmbedLiveSample("Border_width_with_vertical_text", 140, 140)}}
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}
See also
- CSS Logical Properties and Values
- This property maps to one of the physical border properties: {{cssxref("border-top-width")}}, {{cssxref("border-right-width")}}, {{cssxref("border-bottom-width")}}, and {{cssxref("border-left-width")}}
- {{cssxref("writing-mode")}}, {{cssxref("direction")}}, {{cssxref("text-orientation")}}