Thuộc tính vị trí gạch chân văn bản CSS
Ví dụ
Thiết lập vị trí gạch chân trang trí văn bản:
div.a {
text-decoration: underline;
text-underline-position: auto;
}
div.b {
text-decoration:
underline;
text-underline-position: under;
}
Hãy tự mình thử »Định nghĩa và cách sử dụng
Thuộc tính text-underline-position
chỉ định vị trí trang trí gạch chân của 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: | CSS3 |
Cú pháp JavaScript: | object .style.textUnderlinePosition="under" 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-position | 33.0 | 79.0 | 74.0 | 12.1 | 20.0 |
Cú pháp CSS
text-underline-position: auto|under|from-font|left|right|initial|inherit;
Giá trị tài sản
Value | Description | Play it |
---|---|---|
auto | Default value. The browser sets the position of the underline | Demo ❯ |
under | Sets the underline below the alphabetic baseline | Demo ❯ |
from-font | If the font file includes information about underline position, use that value. If not, use auto | |
left | In vertical writing mode the underline will be placed to the left of the text. In horizontal writing mode the underline will be placed as auto | |
right | In vertical writing mode the underline will be placed to the right of the text. In horizontal writing mode the underline will be placed as auto | |
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