10.07.2015 Views

Building the User Interface by Using HTML5: Text, Graphics ... - server

Building the User Interface by Using HTML5: Text, Graphics ... - server

Building the User Interface by Using HTML5: Text, Graphics ... - server

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

30 | Lesson 2Let’s look at some of <strong>the</strong> text elements carried over from HTML 4 that have slightly differentmeaning or functionality in <strong>HTML5</strong>:• : This commonly used element has always represented boldface, and was often usedfor emphasis or to convey importance. The W3C suggests you now use it to indicate“stylistically offset” text without conveying importance. Use for keywords, productnames, and actionable items (such as items you click or press in a list of how-to steps).For example:LICENSED PRODUCT NOT FOR RESALEClick <strong>the</strong> Check button, and <strong>the</strong>n clickOK. • : The italic element is now used for text in an “alternate voice or mood.” Thiscould be spoken text, thoughts, or something similar that doesn’t convey importanceor emphasis. It may also include technical terms and transliterated foreign words.For example:He truly has a kind heart, she thought.• : The strong element is for strong importance, where <strong>the</strong> content is moreimportant than near<strong>by</strong> words. For example:Courtney wore <strong>the</strong> same outfit to work threedays in a row.• : The emphasis element indicates emphatic stress. For example:You should always validate your HTMLmarkup before sharing it with o<strong>the</strong>rs.• : The small element should be used for small print or side comments. Thiselement is useful for copyright lines or adding a source line to an image. For example:Copyright 2012 <strong>by</strong> XYZCorporationThe intended functionality for some of <strong>the</strong>se elements in <strong>HTML5</strong> can be confusing, such asknowing when to use <strong>the</strong> italic element. The best approach is to strive for consistency withina page or Web site, and watch how o<strong>the</strong>r developers use <strong>the</strong> same elements.MODIFY TEXT-RELATED TAGS IN A WEB PAGEGET READY. To modify tags in a Web page, perform <strong>the</strong> following steps:1. In your editing tool, open L2-pet-copyright.html if it’s not already open.2. In <strong>the</strong> following paragraph, replace <strong>the</strong> italic and bold tags with <strong>the</strong> strong element.Make sure your pet has plenty of freshwater during hot wea<strong>the</strong>r.The resulting markup will look like this:Make sure your pet has plenty of freshwater during hot wea<strong>the</strong>r.Note that <strong>the</strong> strong element will look like <strong>the</strong> bold element. The W3C prefersthat you use over , although <strong>the</strong>y seem to produce nearlyidentical results.3. Add start and end tags to <strong>the</strong> copyright line, nesting <strong>the</strong>m properly within<strong>the</strong> paragraph tags.4. Save <strong>the</strong> file as L2-pet-modified.html and view it in a Web browser. See Figure 2-7.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!