Stupid question how to place my three.js into my main div?

Hi,

I have searched the net and yet despite the many examples I can’t seem to apply it to my project.
https://r105.threejsfundamentals.org/threejs/lessons/threejs-align-html-elements-to-3d

Could you tell me how to integrate my scene three.js with a green to die for in my “app” div so that all this ugly color fills my page? Here below is my codesandbox :

Thanks a lot

It’s not really a THREE problem, it’s a HTML problem.

As a quick solution replace this line 48 in “index.js”

document.body.appendChild(renderer.domElement);

with this:

const stl = renderer.domElement.style;
stl.position = "absolute";
stl.top = "0px";
stl.left = "0px";
stl.zIndex = "-1";
1 Like