Skip to content

text-emphasis ​

描述 ​

text-emphasis CSS 属性将强调标记应用于文本(空格和控制字符除外)。它是 text-emphasis-style 和 text-emphasis-color 的简写。

效果展示 ​

语法 ​

css
/* Initial value */
text-emphasis: none; /* No emphasis marks */

/* <string> value */
text-emphasis: "x";
text-emphasis: "点";
text-emphasis: "\25B2";
text-emphasis: "*" #555;
text-emphasis: "foo"; /* Should NOT use. It may be computed to or rendered as 'f' only */

/* Keywords value */
text-emphasis: filled;
text-emphasis: open;
text-emphasis: filled sesame;
text-emphasis: open sesame;

/* Keywords value combined with a color */
text-emphasis: filled sesame #555;

值 ​

  • none 没有强调标记。
  • filled 该形状填充有纯色。如果 filled 和 open 都不存在,则这是默认值。
  • open 形状是空心的。
  • dot 显示小圆圈作为标记。实心点是 '•' ( U+2022 ),空心点是 '◦' ( U+25E6 )。
  • circle 显示大圆圈作为标记。实心圆是 '●' ( U+25CF ),空心圆是 '○' ( U+25CB )。当没有给出其他形状时,这是水平书写模式下的默认形状。
  • double-circle 显示双圆圈作为标记。实心双圆是 '◉' ( U+25C9 ),空心双圆是 '◎' ( U+25CE )。
  • triangle 显示三角形作为标记。实心三角形为 '▲' ( U+25B2 ),空心三角形为 '△' ( U+25B3 )。
  • sesame 显示芝麻作为标记。夹心芝麻是 '﹅' ( U+FE45 ),开放芝麻是 '﹆' ( U+FE46 )。当没有给出其他形状时,这是垂直书写模式下的默认形状。
  • <string> 将给定字符串显示为标记。作者不应在 <string> 中指定多个字符。 UA 可能会截断或忽略由多个字素簇组成的字符串。
  • <color> 定义标记的颜色。如果不存在颜色,则默认为 currentcolor 。