border-inline-start-width

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since January 2020.

Thuộc tính CSS border-inline-start-width xác định độ rộng của đường viền logic phía đầu theo chiều ngang nội tuyến của một phần tử, ánh xạ tới độ rộng đường viền vật lý tương ứng tùy thuộc vào chế độ viết, chiều hướng và hướng văn bản của phần tử đó. Nó tương ứng với thuộc tính border-top-width, border-right-width, border-bottom-width, hoặc border-left-width tùy theo các giá trị được xác định cho writing-mode, direction, và text-orientation.

Try it

border-inline-start-width: thick;
writing-mode: horizontal-tb;
border-inline-start-width: thick;
writing-mode: vertical-rl;
border-inline-start-width: 4px;
writing-mode: horizontal-tb;
direction: rtl;
<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;
}

Cú pháp

css
/* Giá trị <'border-width'> */
border-inline-start-width: 5px;
border-inline-start-width: thick;

/* Giá trị toàn cục */
border-inline-start-width: inherit;
border-inline-start-width: initial;
border-inline-start-width: revert;
border-inline-start-width: revert-layer;
border-inline-start-width: unset;

Các thuộc tính liên quan là border-block-start-width, border-block-end-width, và border-inline-end-width, xác định độ rộng đường viền còn lại của phần tử.

Giá trị

<'border-width'>

Độ rộng của đường viền. Xem border-width.

Định nghĩa hình thức

Initial valuemedium
Applies toall elements
Inheritedno
Percentageslogical-width of containing block
Computed valueabsolute length; 0 if the border style is none or hidden
Animation typeby computed value type

Cú pháp hình thức

border-inline-start-width = 
<line-width>

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

Ví dụ

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: 1px solid blue;
  border-inline-start-width: 5px;
}

Thông số kỹ thuật

Thông số kỹ thuật
CSS Logical Properties and Values Module Level 1
# border-width

Tương thích trình duyệt

Xem thêm