View this post on Medium.com
Emphasize Written Content Using the <em>
Element
Semantic HTML Basics
The <em>
element marks text that is emphasized relative to it's surrounding text, most commonly the contents of a <p>
tag. In english, there is a lot of semantic meaning contained in what you decide to emphasize, so this tag can substantially change the meaning of the content on your page. Take the following example:
<p>
<em>Plants</em> use photosynthesis, while animals have to eat to generate energy.
</p>
The em tag here tells us that plants plants are the focus of this paragraph, not animals.
Why the <em>
element is importatnt
Take the sentence "She isn't flying to hawaii tomorrow".
If you emphasize "She", then the sentence implies (means) that she isn't flying, but other people likely are flying to hawaii tomorrow
If you emphasize the word "hawaii" then the sentence immplies that she is flying to a location other than Hawaii (France, perhaps)
The same concept applies to textual information on our webpages, which is why the em tag is important to include in sections of text.
Em Element Categories
The <em>
element is considered to be "phrasing" content, defined as "the text of the document" and can be used anywhere in the document body where phrasing content is expected. It is most commonly, but not always found as a child of a paragraph (<p>
tag).