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.

42 | Lesson 2Figure 2-165. Press F12 again. An error message appears, stating that it doesn’t recognize aproperty or method. Close <strong>the</strong> error message. The browser window displays <strong>the</strong>fallback text, as shown in Figure 2-16.<strong>Text</strong> displays if <strong>the</strong> browserdoesn’t support canvasLICENSED PRODUCT NOT FOR RESALE6. Leave <strong>the</strong> file, editing tool, and Web browser open if you’re continuing immediatelyto <strong>the</strong> next exercise.✚ MORE INFORMATIONFor more information on <strong>the</strong> canvas element, visit <strong>the</strong> Microsoft <strong>HTML5</strong> <strong>Graphics</strong> Web page at http://bit.ly/M8ZNkf.The HTMLCenter Web site at http://www.htmlcenter.com/blog/rgb-color-chart/ lists RGB color codes.Creating <strong>Graphics</strong> with SVGScalable Vector <strong>Graphics</strong> (SVG) is a language for describing 2D graphics inExtensible Markup Language (XML). XML is a cousin to HTML, and has played animportant part of HTML 4.01 Web pages. SVG technology is not new, but <strong>HTML5</strong>now enables SVG objects to be embedded in Web pages without using <strong>the</strong> or tags. (All types of SVG graphics are referred to as objects, and SVGloads into <strong>the</strong> DOM.)CERTIFICATION READYWhat type of objects canyou create with SVG?2.2The main purpose of SVG, as its name implies, is to create scalable vector graphic shapes,but you can create images and text as well. Much like canvas, you can apply solid colors,gradients, and pattern fills to SVG objects, and copy and clone objects. You can also useSVG anywhere you would insert a PNG, JPG, or GIF. With SVG, you provide drawinginstructions ra<strong>the</strong>r than an image file.One of <strong>the</strong> major benefits of SVG is its flexibility. Its vector graphic changes size to fit <strong>the</strong>screen on which it’s displayed, whe<strong>the</strong>r <strong>the</strong> screen is on a 32-inch computer monitor or amobile device like a smartphone. Because only <strong>the</strong> XML that describes <strong>the</strong> SVG graphic istransmitted, even large images don’t require a lot of bandwidth. This makes SVG handy foruse as a Web page background without having to use <strong>the</strong> repeat property. (Most solid Webpage backgrounds are actually a thin line that’s repeated using a CSS style.) In addition, SVGcan be indexed <strong>by</strong> search engines because it’s created <strong>by</strong> XML.

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

Saved successfully!

Ooh no, something went wrong!