-webkit-text-stroke-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 2017.

Thuộc tính CSS -webkit-text-stroke-color chỉ định màu nét viền của các ký tự văn bản. Nếu thuộc tính này không được đặt, giá trị của thuộc tính color sẽ được dùng.

Cú pháp

css
/* Giá trị <color> */
-webkit-text-stroke-color: red;
-webkit-text-stroke-color: #e08ab4;
-webkit-text-stroke-color: rgb(200 100 0);

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

Giá trị

<color>

Màu sắc của nét viền.

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

Initial valuecurrentcolor
Applies toall elements
Inheritedyes
Computed valuecomputed color
Animation typea color

Cú pháp hình thức

-webkit-text-stroke-color = 
<color>

Ví dụ

Thay đổi màu nét viền

HTML

html
<p>Text with stroke</p>
<input type="color" value="#ff0000" />

CSS

css
p {
  margin: 0;
  font-size: 4em;
  -webkit-text-stroke-width: 3px;
  -webkit-text-stroke-color: red; /* Can be changed in the live sample */
}

Kết quả

Đặc tả

Specification
Compatibility
# the-webkit-text-stroke-color

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

Xem thêm