CSS text-emphasis 属性

定义和用法

text-emphasis 属性用于为文本添加强调标记。

text-emphasis 属性是 text-emphasis-styletext-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