Thuộc tính vị trí nhấn mạnh văn bản CSS
Ví dụ
Sử dụng thuộc tính text-emphasis-position:
h3.ex1 {
text-emphasis: double-circle red;
text-emphasis-position: over;
}
h3.ex2 {
text-emphasis: triangle blue;
text-emphasis-position: under;
}
h3.ex3 {
writing-mode:
vertical-rl;
text-emphasis: triangle blue;
text-emphasis-position: under right;
}
h3.ex4 {
writing-mode: vertical-rl;
text-emphasis: triangle blue;
text-emphasis-position: under left;
}
Hãy tự mình thử »Định nghĩa và cách sử dụng
Thuộc tính text-emphasis-position
chỉ định vị trí của các dấu nhấn mạnh (trên, dưới, trái, phải).
Mẹo: Sử dụng thuộc tính writing-mode
để chỉ định chế độ viết ngang hoặc dọc.
Giá trị mặc định: | phía trên bên phải |
---|---|
Thừa hưởng: | Đúng |
Phiên bản: | CSS3 |
Cú pháp JavaScript: | đối tượng .style.textEmphasisPosition="dưới" |
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-emphasis-position | 99.0 | 99.0 | 46.0 | 7.0 | 85.0 |
Cú pháp CSS
text-emphasis-position:
over|under|left|right|initial|inherit;
Value | Description | |
---|---|---|
over | The emphasis marks are applied over the text (in horizontal writing mode) | Demo ❯ |
under | The emphasis marks are applied under the text (in horizontal writing mode) | Demo ❯ |
left | The emphasis marks are applied to the left of the text (in vertical writing mode) | |
right | The emphasis marks are applied to the right of the text (in vertical writing mode) | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |