html5--inline svg__html

Source: Internet
Author: User
1. What is SVG.
SVG refers to scalable vector graphics (Scalable vector Graphics) SVG is used to define vector based graphics SVG for networks use XML format to define graphics SVG images without any loss of graphic quality in the case of zooming or resizing SVG is the standard of the World Wide Web Consortium 2.SVG Advantage
Compared to other image formats (such as JPEG and GIF), the advantage of using SVG is:
SVG images can be created and modified by a text editor to be searchable, indexed, scripted, or compressed SVG images are scalable SVG images can be printed at any resolution with high quality SVG can be magnified without image quality degradation

3. Embed SVG directly into HTML page

<! DOCTYPE html>
The effect chart is as follows:


The difference between 4.SVG and canvas
SVG is a language that uses XML to describe 2D graphics.
Canvas uses JavaScript to draw 2D graphics.

SVG is xml-based, which means that every element in the SVG DOM is available. You can attach a JavaScript event handler for an element.
In SVG, each drawn graphic is treated as an object. If the properties of the SVG object change, the browser can reproduce the graphic automatically.
Canvas is rendered in pixels. In canvas, once the graphic has been drawn, it will not continue to get the attention of the browser. If its position changes, the entire scene needs to be redrawn, including any object that may have been covered by the graphic.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.