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.

34 | Lesson 2SEE THE EFFECTS OF DEPRECATED ELEMENTSGET READY. To see <strong>the</strong> effects of deprecated elements in an <strong>HTML5</strong> Web page, perform <strong>the</strong>following steps:1. In your editing tool, open L2-pet-mark.html if it’s not already open.2. Modify <strong>the</strong> h1 heading to incorporate <strong>the</strong> center element, as shown:LICENSED PRODUCT NOT FOR RESALECare and Feeding3. Create a new file <strong>by</strong> saving it as L2-pet-temp.html and view it in a Web browser.Did <strong>the</strong> element center <strong>the</strong> heading in your browser?4. Add <strong>the</strong> big element to <strong>the</strong> following content, as shown:Your dog is a friend for life.5. Save <strong>the</strong> file and view it in a Web browser. Do you see <strong>the</strong> effect of <strong>the</strong> big element?See Figure 2-9 as an example.Figure 2-9The effects of <strong>the</strong> center andbig elements6. Go to <strong>the</strong> W3C Markup Validation Service Web page at http://validator.w3.org.Upload L2-pet-temp.html and click Check to have <strong>the</strong> service check it.7. Notice that <strong>the</strong> validator displays errors regarding use of <strong>the</strong> deprecated elements.What can you conclude about using deprecated elements in <strong>HTML5</strong>? (Deprecatedelements don’t validate but many of <strong>the</strong>m still render properly in a Web browser.)8. Close L2-pet-temp.html and leave <strong>the</strong> editing tool and Web browser open if you’recontinuing immediately to <strong>the</strong> next section.■ Choosing and Configuring <strong>HTML5</strong> Tags to Display <strong>Graphics</strong>THE BOTTOM LINEUse <strong>the</strong> img element to display linked images in a Web page. The images can be locatedwith <strong>the</strong> Web pages HTML files, usually in an images subfolder, or on a different <strong>server</strong>or Web site. The figure and figure caption elements are new to <strong>HTML5</strong>, and give youmore control of <strong>the</strong> type of image you are displaying and <strong>the</strong> ability to include captions.The canvas element is used for drawing, rendering, and manipulating images andgraphics dynamically in <strong>HTML5</strong>. Scalable Vector <strong>Graphics</strong> (SVG) enables you to createscalable objects that resize to best fit <strong>the</strong> screen on which <strong>the</strong>y’re viewed, whe<strong>the</strong>r a PCscreen or a smartphone.

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

Saved successfully!

Ooh no, something went wrong!