CSS text-emphasis-position 属性
定义和用法
text-emphasis-position 属性指定强调标记的位置(上、下、左、右)。
提示:使用 writing-mode 属性来指定水平或垂直书写模式。
实例
使用 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;
}
CSS 语法
text-emphasis-position: over|under|left|right|initial|inherit;
属性值
| 值 | 描述 |
|---|---|
| over | 在文本上方应用强调标记(在水平书写模式下)。 |
| under | 在文本下方应用强调标记(在水平书写模式下)。 |
| left | 在文本左侧应用强调标记(在垂直书写模式下)。 |
| right | 在文本右侧应用强调标记(在垂直书写模式下)。 |
| initial | 将此属性设置为其默认值。参阅 initial。 |
| inherit | 从其父元素继承此属性。参阅 inherit。 |
技术细节
| 默认值: | over right |
|---|---|
| 继承性: | yes |
| 版本: | CSS3 |
| JavaScript 语法: | object.style.textEmphasisPosition="under" |
浏览器支持
表格中的数字表示首个完全支持该属性的浏览器版本。
| Chrome | Edge | Firefox | Safari | Opera |
|---|---|---|---|---|
| 99.0 | 99.0 | 46.0 | 7.0 | 85.0 |