| Depr. | Empty | Version |
|---|---|---|
| No | No | HTML 2 |
| IE5.5+ | FF1+ | SA1.3+ | OP9.2+ | CH2+ |
|---|---|---|---|---|
| Full | Full | Full | Full | Full |
Syntax
Description
The em
element is used to emphasize text content, and displays in italics in all
current browsers. It provides semantic meaning about the text it contains,
effectively saying, “this text is slightly more important than other text
here.” This differentiates em from the i element, which merely sets the font to italics. In most
cases, em is the preferred element to use.
The example code above would render as shown in Figure 1.
em in the
browser
The em element shouldn’t be used simply to
italicize text; the fact that emphasized text is rendered in italics is
coincidental. If you have a burning desire to make text italic, but not
for the purposes of emphasis, use CSS instead.
Example
This example shows the
em element in action:
<p>Do you <em>really</em> need to buy those expensive jeans? I mean,
is it really <em>that</em> important to you to look like some kind
of circus freak?</p>
Use This For …
This element is used to mark up text content of any kind that needs moderate emphasis.
Compatibility
| Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 8.0 | 1.0 | 1.5 | 2.0 | 3.0 | 3.5 | 1.3 | 2.0 | 3.1 | 4.0 | 9.2 | 9.5 | 10.0 | 2.0 |
| Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full | Full |
As one of the
earliest formatting elements, em has full browser
support.
User-contributed notes
There are no comments yet.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.