G
G
gleendo2016-07-15 17:19:33
css
gleendo, 2016-07-15 17:19:33

How to make canvas full width and height of viewport?

How to make canvas area full width and height of viewport?
Demo - codepen.io/evg_/pen/xOpYvO
Tried to specify:

canvas.width = document.documentElement.clientWidth;
canvas.height = document.documentElement.clientHeight;

But when the screen is zoomed out, scrollbars appear. How can I make it so there are no scrollbars? So that the canvas can be said to be adaptive..

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Bogomazov, 2016-07-15
@evgeniy8705

stack overflow

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question