Thursday, 28 February 2013

Adding Importance to Text | HTML5 Tutorial pdf

Adding Importance to Text

Problem
You want to indicate a span of text that is important.
Solution
Contain the important text with the strong element:
<p><strong>Registration is required</strong> for this event.</p>

Discussion

In previous versions of HTML, strong was used to indicate strong emphasis. Now, in HTML5 strong indicates importance, such as alerts and warnings.
Redefining <b>
Much like it’s shunned sibling i, the b element makes a comeback in HTML5. No longer considered a presentational element, b is used to stylistically offset text from the normal prose without conveying any extra importance.
For example, b could be used for keywords, product names, or other content whose text would typically be unique compared to surrounding text such as a paragraph lead:
<p><b>Once upon a time,</b> there was a man who lost his mind.</p>
The difference between strong and b is now more semantically clear, but both are typically rendered in browsers with a heavier font weight . Of course, CSS lets you change the default styling as needed.

No comments: