HOW-TO

How to italicize and underline text in HTML

<em> vs <i>, <u> vs CSS text-decoration, styling a whole section, removing link underlines, and fixes when italic or underline will not show.

4 min read·

To italicize text in HTML, wrap it in <em> or <i>: This is <em>important</em>. To underline it, wrap it in <u> or use CSS: <span style="text-decoration: underline;">underlined</span>. Both work in every browser with no extra files.

Italic: <em> or <i>

  • ✓<em>…</em> marks stress, the word you would say louder: I said <em>Tuesday</em>, not Thursday. Screen readers can change their tone for it.
  • ✓<i>…</i> marks text that is set apart without stress: book and film titles, foreign words, ship names, a thought. Both show in italics by default.
  • ✓For italics that are only a look, with no meaning, use CSS: .note { font-style: italic; }.
  • ✓To stop text being italic (for example inside an <em> that a theme styles), use font-style: normal;.

Underline: <u> or CSS

  • ✓<u>…</u> underlines text. In current HTML it means text with a non-textual note, such as a misspelling; it is fine for a short phrase.
  • ✓For an underline that is only styling, use CSS: .underline { text-decoration: underline; }.
  • ✓Change how it looks: text-decoration-color: #e11d48; text-decoration-thickness: 2px; text-underline-offset: 4px; (moves the line further below the text).
  • ✓Dotted or wavy lines: text-decoration-style: dotted; or wavy;.
  • ✓Readers expect underlined text to be a link, so underline sparingly in body text; bold or a highlight is often clearer.

Both at once, or a whole section

Nest the tags: <em><u>read this first</u></em>, or set both in one CSS rule: .callout { font-style: italic; text-decoration: underline; }. To style every paragraph in a block, put the class on the parent: <div class="callout">…</div>. Bold works the same way with <strong> or font-weight: 700; (see how to bold text in HTML).

Remove or add the underline on links

  • ✓Browsers underline links by default. Remove it with a { text-decoration: none; }.
  • ✓Bring it back on hover so people still see it is a link: a:hover { text-decoration: underline; }.
  • ✓Only some links: give them a class, .nav a { text-decoration: none; }.
  • ✓The line under a link is drawn by text-decoration, not border-bottom, unless the page sets a border; check both if it will not go away.

When italic or underline does not show

  • ✓The font has no italic: some web fonts load only the regular style, so the browser fakes a slant or shows none. Load the italic file too (for Google Fonts, add ital to the font URL).
  • ✓A reset or framework removes it: Tailwind sets links to no underline. Add the class italic or underline to the element.
  • ✓A more specific rule wins: a theme rule such as .content em { font-style: normal; } overrides yours. Inspect the element (right-click, Inspect) to see which rule applies.
  • ✓The tag is not closed: an unclosed <em> or <u> styles everything after it. Check each opening tag has its closing tag.
  • ✓Cached file: reload with Ctrl+Shift+R (Cmd+Shift+R on a Mac).

Pages made with AI tools

Pages from Claude, ChatGPT and other tools often use Tailwind, where the style is a class: italic, not-italic, underline, no-underline, decoration-2 (thickness), underline-offset-4 and hover:underline. Add or remove the class on the element instead of adding new tags.

Share the page as a link

With FileShare Pro you upload the .html file from the dashboard, copy the link and send it; it opens as a page in any browser and the person opening it needs no account. To change the text after you send it, edit the file and upload it to the same link. Related: how to change the font and font size in HTML and how to add a link in HTML. Sign up free to share your first page.

Frequently asked

What is the HTML tag for italics?

<em> for stressed words and <i> for titles, foreign words and other text set apart. Both show in italics. For a purely visual style, use font-style: italic; in CSS.

How do I underline text in HTML?

Wrap it in <u>…</u>, or use CSS: text-decoration: underline;. CSS also lets you set the color, thickness and offset of the line.

Should I use <em> or <i>?

Use <em> when the word carries stress and <i> for titles, foreign words and terms. They look the same; the difference is meaning, which screen readers and search engines can use.

How do I remove the underline from a link?

Add a { text-decoration: none; } to your CSS, or text-decoration: none; on one link. Add a:hover { text-decoration: underline; } so people can still tell it is a link.

Got a page to share?

Drop the file, copy the link — live in seconds, free plan included.

Start sharing free