I have a program where I place the element using CSS in % of window height and width. When opened in a monitor with different resolution (only if the ratio height-width is different), the elements are a little bit misplaced. My solution is limit the height of the window when open in Chrome, so I can keep the same ratio. Researching in google, the command ResizeTo looks to be the answer and it looks simple, but I can't make it to work. the command ResizeTo doesn't work at all, what am I doing wrong?
HTML code:
<HTML>
<HEAD>
<TITLE>this is an HTML example</TITLE>
</HEAD>
<body style= "width:100%; height:100%; background-color:lightgrey;">
<H1>This is a Header</H1>
<H2>This is a Medium Header</H2>
<P> This is a new paragraph!
<P> <B>This is a new paragraph!</B>
<BR> <B><I>This is a new sentence without a paragraph break, in bold italics.</I></B>
<script src="window.js" ></script>
</body>
</HTML>
Javascript:
window.resizeTo(1024,900)