Software, your way.
burger menu icon
WillMaster

WillMaster > LibraryWeb Content Preparation

FREE! Coding tips, tricks, and treasures.

Possibilities weekly ezine

Get the weekly email website developers read:

 

Your email address

name@example.com
YES! Send Possibilities every week!

Text Emphasis

Do you write content that frequently can be improved with just the right amount of emphasis?

CSS properties for emphasizing text are:

text-emphasis-style
text-emphasis-color
text-emphasis-position

text-emphasis-style

When you specify a text-emphasis-style property, the browser renders an emphasis based on your style.

Here is an example of a style with filled triangles for emphasis.

They say birds have wings so they can fly.

Here is the source code for the above.

They say <span style="text-emphasis-style: filled triangle;">birds have wings</span> so they can fly.

The text-emphasis-style values that may be specified are:

ValueExample
filled dot
open dot
filled circle
open circle
filled double-circle
open double-circle
filled triangle
open triangle
filled sesame
open sesame
[any character][character]

For illustrating how to specify any character as the text-emphasis-style value, here is an example that specifies the capital letter "I" as the character. The example is immediately followed by the source code.

They say birds have wings so they can fly.

They say <span style="text-emphasis-style: 'I';">birds have wings</span> so they can fly.

Note that the CSS property's value (the letter I) is between single-quotes. That should be double-quotes in the source code when the style attribute's value is between single quotes. Here is example code for that eventuality.

They say <span style='text-emphasis-style: "I";'>birds have wings</span> so they can fly.

text-emphasis-color

When you specify a text-emphasis-color property, the browser renders the emphasis characters based on your color preference.

Here is an example of a style with orange filled triangles for emphasis.

They say birds have wings so they can fly.

Here is the source code for the above.

They say <span style="text-emphasis-color: orange; text-emphasis-style: filled triangle;">birds have wings</span> so they can fly.

Any valid HTML color can be specified. As an example, orange can also be specified as #fda429, rgb(253,164,41), or hsl(35,98%,58%).

text-emphasis-position

The browser default position for emphasis characters generally is over the text.

The emphasis characters may be specified for under the text with the CSS text-emphasis-position property. The value of that property may be over for the general default position or under to place the emphasis characters under the text.

Here is an example of orange triangle characters placed under the text for emphasis. Immediately following the example is the source code. (Note: Some older browsers won't implement emphasis below the text even though they do implement emphasis above the text.)

They say birds have wings so they can fly.

They say <span style="text-emphasis-position: under; text-emphasis-color: orange; text-emphasis-style: filled triangle;">birds have wings</span> so they can fly.

Emphasis Choice

With the ability to specify style, color, and position, you have wide leeway for how you want to emphasize text in your content.

(If you wish to specify text-emphasis-style and text-emphasis-color with shorthand, see the Mozilla text-emphasis page.)

The emphasis you choose will depend on personal preference and how it seems best for the audience you expect.

(This content first appeared in Possibilities newsletter.)

Will Bontrager

Was this article helpful to you?
(anonymous form)

Support This Website

Some of our support is from people like you who see the value of all that's offered for FREE at this website.

"Yes, let me contribute."

Amount (USD):

Tap to Choose
Contribution
Method

All information in WillMaster Library articles is presented AS-IS.

We only suggest and recommend what we believe is of value. As remuneration for the time and research involved to provide quality links, we generally use affiliate links when we can. Whenever we link to something not our own, you should assume they are affiliate links or that we benefit in some way.

How Can We Help You? balloons
How Can We Help You?
bullet Custom Programming
bullet Ready-Made Software
bullet Technical Support
bullet Possibilities Newsletter
bullet Website "How-To" Info
bullet Useful Information List

© 1998-2001 William and Mari Bontrager
© 2001-2011 Bontrager Connection, LLC
© 2011-2025 Will Bontrager Software LLC