Adjusting position of HTML elements?

The way I would do this is to use the PlayCanvas UI system and anchor it to the top left corner.

Every frame (or on window resize), you can get the canvas corners of PlayCanvas UI element to position the HTML element to the window: https://developer.playcanvas.com/api/pc.ElementComponent.html#canvasCorners

This library by Cem uses a similar technique: PlayCanvas UI Components