Custom element with proportional size

Hello i want to make custom element that will be let’s say blue rectangle (in real it will be webgame) with proportion 16:9 and will automatically adjust to window size. I want it to be on the top of browser and centered vertically. I encoutered problem that manually i can set custom width and height in wix editor, but i don’t want it, and when i wanted to overwrite it by setAttribute for example it didn’t work. How to do it ?