The width, height of the Canvas, and the width, height, and widthcanvas of the Canvas in the style.

Source: Internet
Author: User

The width, height of the Canvas, and the width, height, and widthcanvas of the Canvas in the style.

You can control the size of a Canvas in either of the following ways:

1: directly set the book width and height attribute values on the Canvas label;

2: Set the width and height of the Canvas through Css;

 

There is a big difference between the two methods.

1: The Canvas width and height are 300*150 by default. When you set the width and height attribute values of the label, the width and height of the Canvas element are controlled, and the width and height of the Canvas. Two values are set at the same time.

2: When Css sets width and height, it only controls the width and height of the Canvas element, without changing the Canvas size.

 

Therefore, you can use styles to control the size of the Canvas and zoom in and out the Canvas content.

Related Article

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.