About limiting canvas space to div

Greetings to everyone. I am working with tailwindcss. I want to limit the world to the size of a particular “div” but I haven’t succeeded. I request your help in this matter.

On the div → position: relative;
Inside the div place a canvas element and style it as → position: absolute; top: 0; left: 0; width: 100%; height 100%;

(Or tailwind css class equivalents ofc. And be sure to scale renderer resolution properly to not over-/undersample the rendering unnecessarily.)

Thank you very much for your help. This is what it looks like now. :confused:

Be sure to do this whenever rescaling the canvas or the renderer :eyes:

1 Like

Thank you very much. I fixed the problem. I appreciate your help and comment.