border-inline-style

Baseline Widely available

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

Thuộc tính CSS border-inline-style xác định kiểu của các đường viền logic theo chiều ngang nội tuyến của một phần tử, ánh xạ tới kiểu đườ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-styleborder-bottom-style, hoặc border-left-styleborder-right-style tùy theo các giá trị được xác định cho writing-mode, direction, và text-orientation.

Kiểu đường viền theo chiều còn lại có thể được thiết lập bằng border-block-style, vốn thiết lập border-block-start-styleborder-block-end-style.

Try it

border-inline-style: dotted;
writing-mode: horizontal-tb;
border-inline-style: dotted;
writing-mode: vertical-rl;
border-inline-style: groove;
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: #eeeeee;
  color: black;
  border: 0.75em solid;
  padding: 0.75em;
  width: 80%;
  height: 100px;
  unicode-bidi: bidi-override;
}

Cú pháp

css
/* Giá trị <'border-style'> */
border-inline-style: dashed;
border-inline-style: dotted;
border-inline-style: groove;

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

Giá trị

<'border-style'>

Kiểu đường của đường viền. Xem border-style.

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

Initial valuenone
Applies toall elements
Inheritedno
Computed valueas specified
Animation typediscrete

Cú pháp hình thức

border-inline-style = 
<'border-top-style'>{1,2}

<border-top-style> =
<line-style>

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

Ví dụ

Thiết lập border-inline-style

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: 5px solid blue;
  border-inline-style: dashed;
}

Thông số kỹ thuật

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

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

Xem thêm