border-inline-color

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 border-inline-color CSS xác định màu của các đường viền nội tuyến logic của phần tử, ánh xạ tới màu đường viền vật lý tùy thuộc vào chế độ viết, hướng và hướng văn bản của phần tử. Nó tương ứng với border-top-colorborder-bottom-color, hoặc border-right-colorborder-left-color tùy thuộc vào các giá trị được xác định cho writing-mode, directiontext-orientation.

Màu đường viền ở chiều kia có thể được đặt bằng border-block-color, để đặt border-block-start-colorborder-block-end-color.

Try it

border-inline-color: red;
writing-mode: horizontal-tb;
border-inline-color: #32a1ce;
writing-mode: vertical-rl;
border-inline-color: rgb(170 50 220 / 0.6);
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
border-inline-color: yellow;
border-inline-color: #f5f6f7;

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

Giá trị

<color>

Màu sắc của đường viền.

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

Initial valuecurrentcolor
Applies toall elements
Inheritedno
Computed valuecomputed color
Animation typeby computed value type

Cú pháp hình thức

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

<border-top-color> =
<color> |
<image-1D>

<image-1D> =
<stripes()>

<stripes()> =
stripes( <color-stripe># )

<color-stripe> =
<color> &&
[ <length-percentage> | <flex> ]?

<length-percentage> =
<length> |
<percentage>

Ví dụ

Màu đường viền với văn bản dọc

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: 10px solid blue;
  border-inline-color: red;
}

Kết quả

Thông số kỹ thuật

Specification
CSS Logical Properties and Values Module Level 1
# propdef-border-inline-color

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

Xem thêm