Thursday, 28 February 2013

Emphasizing Text | HTML5 Tutorial pdf

Emphasizing Text

Problem
You want to add emphasis or emphatic stress to text content.
Solution
Contain the text to be emphasized with the em element:
<p>My name is <em>Jane</em>, not John.</p>

Discussion

After looking at this example, you may be wondering what is new here, since em has been around since HTML 4. The difference is that HTML5 slightly redefines em for text with “emphatic stress,” which I translate as any text that, when spoken, I would verbally emphasize.
Redefining <i>
Another change in HTML5’s text-level semantics is that the i element is no longer considered presentational. You can now use i to indicate text that is in an alternate voice or mood, or somehow offset from the normal prose.
For example, a taxonomic designation, a technical term, a thought, an idiomatic phrase, or some other text whose typical typographic presentation is italicized:
<p>Sally thought to herself, <i>when will IE6 die?</i>.</p>
Despite the new semantic distinction, browsers typically render both em and i in italics. Of course, you can change the default styling of either element with CSS.

No comments: