Emphasizing text in CSS
By using the CSS text-emphasis
property, you can draw attention to textual elements (letters, numbers, but not spaces or control characters):
p {
text-emphasis: filled sesame;
-webkit-text-emphasis: filled sesame;
}
The text emphasis symbols are about a half the font size. It can also affect line height.
How to use CSS emphasis
CSS text-emphasis
is actually a shorthand for two subproperties:
text-emphasis-style
text-emphasis-color
Therefore, the syntax is similar to that of many other shorthands:
text-emphasis: style color;
The CSS text emphasis style can be defined in:
- Keywords:
none
(the default value),filled
,open
,dot
,circle
,double-circle
,triangle
, orsesame
- A string containing one character that will be used as the CSS emphasis symbol
You can define the CSS text emphasis color using a name, RGB, RGBA, HEX, HSL or HSLA value. If you don't specify the color, CSS text emphasis will use the color of the text.
Tip: to get the value for the exact color tone you need, use the Pickeristic color picker.