Home > Web Front-end > HTML Tutorial > Make HTML5 canvas fill the entire page

Make HTML5 canvas fill the entire page

WBOY
Release: 2023-08-29 19:53:02
forward
861 people have browsed it

Make HTML5 canvas fill the entire page

For the canvas to fill the entire page, the width and height of the page need to be 100%.

* {
   margin: 0;
   padding: 0;
}
body, html {
   height:100%;
}
#canvas {
   position:absolute;
   height:100%; width:100%;
}
Copy after login

The above is the detailed content of Make HTML5 canvas fill the entire page. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template