What Is the EM Tag?

The <em> tag is a text-level semantic HTML element intended to identify emphasized text and will display in modern browsers as italic text. Although the <i> tag will also display italic text, these two tags are not interchangeable and should be used in different situations; similarly, the <strong> tag, another semantic HTML element used to identify important text, is not interchangeable with the <em> tag.

Other People Are Reading

  1. Usage

    • Use the <em> tag to emphasize single words or short phrases within a sentence when the context calls for it. For example, if you are discussing the merits of your favorite character on a television show, you might mention that "certain people may dismiss the importance of this character, but I firmly believe that he is absolutely essential to the show." In this case, you may place the words "absolutely essential" within an <em> tag to place a specific emphasis on them.

      The placement of the <em> tag may change the meaning of a sentence entirely. Compare "<em>John</em> is my favorite brother" with "John <em>is</em> my favorite brother;" the former sentence could be typed in response to somebody insisting that Bill is your favorite brother, while the latter could be typed in response to insistence that John is not your favorite brother.

    <em> versus <i>

    • When no CSS styles are applied, both the <em> and the <i> tag will have visually identical results, rendering on screen as italic text. However, these two tags have different uses. The <i> tag is intended for use on specific text that needs to stand out from the rest of the sentence or paragraph for reasons other than emphasis; examples of text for which the <i> tag would be more appropriate than the <em> tag would be phrases in a different language, technical terms or scientific names for plants and animals.

    <em> versus <strong>

    • While the <em> tag merely represents emphasis, the <strong> tag is used to highlight the strong importance of the text it is applied to. For example, if you are discussing your favorite television show, you can place a spoiler warning at the top of the page and enclose it within a <strong> tag to denote its importance. The placement of the <strong> tag will never change the meaning of a sentence -- it merely identifies what the most important parts of it are.

    Styling <em>

    • Change how the <em> tag is displayed on the screen with CSS. For example, the following code will cause all text within <em> tags to display as red, underlined, non-italic text:

      em {

      color: #FF0000;

      font-style: normal;

      text-decoration: underline;

      }

Related Searches:

References

Comments

Related Ads

Featured