In Css, how to size and position a html5 canvas in javascript


0 votes
asked Mar 16, 2016 by Arpbe (280 points)
i am using javascript to dynamically create canvas and display it on webpage but size of canvas and position of canvas both vary based on size of device that is viewing. Thank you for your help

4 Answers

0 votes
answered May 30, 2016 by Vf_Pye (440 points)
selected May 30, 2016 by guvlotof
 
Best answer
How to build an appFree graphic design software available to you right now
0 votes
answered Mar 28, 2016 by Va1705In (670 points)
Well luckily for us, it does have have a resize method, and it does exactly that. The result is a canvas element that perfectly fills the browser window.
If all went well you should see a blank canvas.
So now you know how angles work in canvas.
commented Mar 30, 2016 by qba_60 (430 points)
Alongside fillRect is the strokeRect method, the evil twin
commented Mar 30, 2016 by Gur6704The (1,470 points)
I handled this by the following code but I am not sure if this a good approach. I hope it will work for you
commented Mar 30, 2016 by orr_66 (1,190 points)
I handled this by the following code but I am not sure if this a good approach. I hope it will work for you
0 votes
answered May 2, 2016 by Bawek (1,030 points)
There is a write up that I found very helpful HTML Canvas - W3Schools
–1 vote
answered May 9, 2016 by Kridler_Usin (1,120 points)
I try all solutions inside this topic on this time
For example, Responsive HTML5 Canvas Game - HTML5 Gamer then gives you a zip file to download

What is Geekub?

Q&A site for professional and enthusiast programmers, software developers and other technical users. With your help, we hope to work together to build a library of detailed answers to just about any question that is related to programming!







...