レスポンシブな方法で機能するように、ランダムに生成された単語を含むページを作成しようとしています。
<head>
<style type='text/css'>
.box {
height: auto;
position: absolute;
width: auto;
}
</style>
<script type='text/javascript'>
function setDivPos() {
for (i=1; i<=2; i++) {
var x = Math.floor(Math.random()*1130);
var y = Math.floor(Math.random()*722);
document.getElementById('div'+i).style.left = x + 'px';
document.getElementById('div'+i).style.top = y + 'px';
}
</head>
<body onload='setDivPos();'>
<div id='div1' class='box'>ARCHIVE</div>
<div id='div2' class='box'>PERSPECTIVE</div>
</div>
</body>
ウェブサイト全体は、ほぼこのアルゴリズムに基づいています。これらのランダムに配置されたオブジェクトを 1130x722 の領域内に配置し、各ユーザーの画面サイズ内に配置するにはどうすればよいですか。(応答)