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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

38 | Lesson 23. Replace <strong>the</strong> markup for <strong>the</strong> figure that follows <strong>the</strong> h1 element with <strong>the</strong> following,replacing <strong>the</strong> image file names (doghappy.jpg, dogpaws.jpg, and dogwalk.jpg) withyour image file names:LICENSED PRODUCT NOT FOR RESALEHappy dogs are good dogs4. Save <strong>the</strong> file as L2-pet-multpimage.html and view it in a Web browser. The pageshould look similar to Figure 2-13.Figure 2-13The Web page with multipleimages and a captionIllustrations: © MightyIsland/iStockphoto5. Close <strong>the</strong> L2-pet-multpimage.html file. Leave <strong>the</strong> editing tool and Web browser openif you’re continuing immediately to <strong>the</strong> next exercise.Creating <strong>Graphics</strong> with CanvasThe canvas element is new in <strong>HTML5</strong> and creates a container for graphics, and usesJavaScript to draw <strong>the</strong> graphics dynamically.With canvas, <strong>the</strong> Web page becomes a drawing pad, and you use JavaScript commands todraw pixel-based shapes on a canvas that include color, gradients, and pattern fills. Canvasalso enables you to render text with various embellishments, and animate objects <strong>by</strong> making<strong>the</strong>m move, change scale, and so on.

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

Saved successfully!

Ooh no, something went wrong!