Jump to content

proper coding for bold or italics


owosso
 Share

Recommended Posts

What's the most correct way to bold or italicize a random word in the text? HTML? Or a CSS class?
I've always used <b></b> and <i></i>, but semantically, I believe <strong></strong> and <em></em> are the better way to go.
Link to comment
Share on other sites

<strong> and <em> are incorrect if the words you're italicizing are not meant to be emphasized.Example of incorrect use:

The latin word for stone is <em>lapis</em>.

Example of correct use:

There <em>has</em> to be a solution to this problem

Use <b> and <i> (or a CSS styled <span>) when you're not showing emphasized text.

Link to comment
Share on other sites

Text inside <strong> and <em> tags are read differently by screen readers. If you just want the style use CSS.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...