CSS text-emphasis-position 属性
示例
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;
}
自己动手试一试 »
定义和用法
text-emphasis-position 属性指定了强调标记的位置(over, under, left, right)。
提示:使用 writing-mode 属性来指定水平或垂直书写模式。
| 默认值 | over right |
|---|---|
| 继承 | 是 |
| 版本 | CSS3 |
| JavaScript 语法 | object.style.textEmphasisPosition="under" |
浏览器支持
表中的数字指定了完全支持该属性的第一个浏览器版本。
| 属性 | |||||
|---|---|---|---|---|---|
| text-emphasis-position | 99.0 | 99.0 | 46.0 | 7.0 | 85.0 |
CSS 语法
text-emphasis-position: over|under|left|right|initial|inherit;
| 值 | 描述 | |
|---|---|---|
| over | 强调标记应用于文本的上方(在水平书写模式下) | 演示 ❯ |
| under | 强调标记应用于文本的下方(在水平书写模式下) | 演示 ❯ |
| left | 强调标记应用于文本的左侧(在垂直书写模式下) | |
| right | 强调标记应用于文本的右侧(在垂直书写模式下) | |
| initial | 将此属性设置为其默认值。阅读关于initial | |
| inherit | 从其父元素继承此属性。阅读关于inherit |