Thuộc tính CSS text-gạch chân-offset
Ví dụ
Thiết lập khoảng cách offset của trang trí gạch chân văn bản:
div.a {
text-decoration: underline;
}
div.b {
text-decoration: underline;
text-underline-offset: 10px;
}
div.c {
text-decoration: underline wavy blue;
}
div.d
{
text-decoration: underline wavy blue;
text-underline-offset: 10px;
}
Hãy tự mình thử »Định nghĩa và cách sử dụng
Thuộc tính text-underline-offset
chỉ định khoảng cách offset của trang trí gạch chân văn bản.
Giá trị mặc định: | tự động |
---|---|
Thừa hưởng: | Đúng |
Hoạt hình: | KHÔNG. Đọc về hoạt hình |
Phiên bản: | CSS4 |
Cú pháp JavaScript: | đối tượng .style.textUnderlineOffset="1em" Hãy dùng thử |
Hỗ trợ trình duyệt
Các số trong bảng chỉ định phiên bản trình duyệt đầu tiên hỗ trợ đầy đủ thuộc tính.
Property | |||||
---|---|---|---|---|---|
text-underline-offset | 87.0 | 87.0 | 70.0 | 12.1 | 73.0 |
Cú pháp CSS
text-underline-offset: auto| length | percentage |initial|inherit;
Giá trị tài sản
Value | Description | Play it |
---|---|---|
auto | Default value. The browser sets the appropriate offset for the underline | Demo ❯ |
length | Specifies the offset as a length value | Demo ❯ |
percentage | Specifies the offset as a percentage value | Demo ❯ |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Trang liên quan
Hướng dẫn CSS: Trang trí văn bản CSS
Tham chiếu DOM HTML: thuộc tính textDecoration