SamSmith SamSmith - 2 months ago 11
CSS Question

Simulate em tag in CSS

I am trying to eradicate my HTML code of tags such as

<strong>
,
<i>
,
<b>
, and
<em>
. I understand that
<strong>
and
<b>
can be accomplished in CSS by using
font-weight: bold
. I also understand that
<italic>
can be accomplished in CSS by using
font-weight: italic
. However, I am not sure how what the CSS equivalent for
<em>
is. After a lot of research, I really do not even see the difference between
<strong>
,
<b>
, and
<em>
.

Therefore, what is the difference between
<strong>
,
<b>
, and
<em>
, and what is the CSS equivalent of
<em>
? Any suggestions are appreciated. Thank you.

Answer

The em tag is a semantic tag for "emphasis" which most browsers render as font-style: italic:

JS Fiddle


Most browsers will display the element with the following default values:

em { 
    font-style: italic;
}

Source: HTML em tag