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.

36 | Lesson 2The figure element specifies <strong>the</strong> type of figure you’re adding, such as an image, diagram, photo,and so on. This element provides a major benefit: <strong>the</strong> ability to easily add multiple images side <strong>by</strong>side. With HTML 4, doing so requires a good bit of markup. The figcaption element isoptional. It adds a caption to an image on a Web page, and you can display <strong>the</strong> caption before orafter <strong>the</strong> image.The following markup uses <strong>the</strong> figure element, specifies <strong>the</strong> width and height of <strong>the</strong> image,and adds a caption. The result is shown in Figure 2-10:LICENSED PRODUCT NOT FOR RESALEHappy dogs are good dogsFigure 2-10<strong>Using</strong> <strong>the</strong> figure andfigcaption elementsto display an image with acaptionIllustration: © MightyIsland/iStockphotoThe following markup is for a figure with multiple images that share a single caption, <strong>the</strong>results of which are shown in Figure 2-11:Happy dogs are good dogsFigure 2-11<strong>Using</strong> <strong>the</strong> figure andfigcaption elements todisplay multiple images side <strong>by</strong>side with a single captionIllustrations: © MightyIsland/iStockphoto

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

Saved successfully!

Ooh no, something went wrong!