🚨 Time is Running Out: Reserve Your Spot in the Lucky Draw & Claim Rewards! START NOW

Code has been added to clipboard!

CSS Text Emphasis

Reading time 1 min
Published Aug 8, 2017
Updated Sep 27, 2019

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):

Example
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.

DataCamp
Pros
  • Easy to use with a learn-by-doing approach
  • Offers quality content
  • Gamified in-browser coding experience
  • The price matches the quality
  • Suitable for learners ranging from beginner to advanced
Main Features
  • Free certificates of completion
  • Focused on data science skills
  • Flexible learning timetable
Udacity
Pros
  • Simplistic design (no unnecessary information)
  • High-quality courses (even the free ones)
  • Variety of features
Main Features
  • Nanodegree programs
  • Suitable for enterprises
  • Paid Certificates of completion
edX
Pros
  • A wide range of learning programs
  • University-level courses
  • Easy to navigate
  • Verified certificates
  • Free learning track available
Main Features
  • University-level courses
  • Suitable for enterprises
  • Verified certificates of completion

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, or sesame
  • 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.

Browser support

Browser image
Chrome
25+
Browser image
Edge
-
Browser image
Firefox
46+
Browser image
IE
-
Browser image
Opera
15+
Browser image
Safari
6.1+

Mobile browser support

Browser image
Chrome
25+
Browser image
Firefox
46+
Browser image
Opera
14+
Browser image
Safari
7+