CSS text-emphasis 屬性
定義和用法
text-emphasis
屬性用于為文本添加強調標記。
text-emphasis
屬性是 text-emphasis-style 和 text-emphasis-color 的簡寫。
提示:強調標記的大小約為字體大小的 50%。
實例
使用 text-emphasis
屬性:
p.ex1 { text-emphasis: filled; } p.ex2 { text-emphasis: open; } p.ex3 { text-emphasis: double-circle red; } p.ex4 { text-emphasis: triangle blue; }
CSS 語法
text-emphasis: none|filled|open|dot|circle|double-circle|triangle|sesame|string|color|initial|inherit;
屬性值
值 | 描述 |
---|---|
none | 不應用強調標記。 |
filled | 強調標記填充為實心顏色。 |
open | 強調標記為空心。 |
dot | 強調標記為小圓點。 |
circle | 強調標記為圓形。 |
double-circle | 強調標記為雙圓形。 |
triangle | 強調標記為三角形。 |
sesame | 強調標記為芝麻形(即小點簇)。 |
string | 強調標記為給定的字符串(一個字符)。 |
color | 設置強調標記的顏色。 |
initial | 將此屬性設置為其默認值。參閱 initial。 |
inherit | 從其父元素繼承此屬性。參閱 inherit。 |
技術細節
默認值: | none currentcolor |
---|---|
繼承性: | yes |
版本: | CSS3 |
JavaScript 語法: | object.style.textEmphasis="filled blue" |
瀏覽器支持
表格中的數字表示首個完全支持該屬性的瀏覽器版本。
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
99.0 | 99.0 | 46.0 | 7.0 | 85.0 |