Visit Mozilla.org

HTML:Element:em

From MDC

Contents

[edit] HTML Emphasis Element

<em>...</em> - The HTML Em element gives text emphasis, typically this is displayed in italics.

[edit] Example

   <p>
   
       It is important to note that you <em>cannot</em> login 
       until you verify your account via the email sent to the address you provided.
   
   </p>

[edit] Result

It is important to note that you cannot login until you verify your account via the email sent to the address you provided.

[edit] Italics vs. Emphasis

It is often confusing to new developers why there are so many ways to express the same thing on a rendered website. Italics and emphasis are perhaps one of the most common. Why use <em></em> vs <i></i>? It produces the exact same result right?

Not exactly, emphasis is a logical state, and italics is a physical state. Logical states separate presentation from the content, and by doing so allows for it to be expressed in many different ways, perhaps instead of rendering some text as italics you want to render it red, or a different size, or underlined, or even bold. It makes more sense to change the presentational properties of em than it does italics. This is because of italics is a physical state, there is no separation of presentation and content, making italics do anything other than italicize text would be confusing and illogical.

[edit] See also


HTML Elements
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
(Quick Links: HTML Element Cross Reference, HTML Category)