How to Italicize and Bold Text in HTML
There are plenty of ways to mark up text in HTML, but often there is a right way.
HTML5 is the beginning of an era of true semantics on the web. While systems like search engines and screen readers have yet to fully take advantage of HTML’s semantics elements (such as em
, strong
, etc), that doesn’t mean we should prepare for the day that they do.
In that spirit, here’s a quick demonstration of the various options for italicizing and bolding text:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Our favorite cruise was on the <i>Explorer of the Seas</i>, --> italicize the name of a ship | |
which we read about in <cite>Cruising</cite> magazine, --> reference the name of a publication | |
and we <em>loved</em> it. --> emphasize a feeling | |
(<b>Note:</b> This was before everyone got all sick --> start a note with bolded text | |
and was throwing up <strong>everywhere</strong>.) --> make a strong statement |