【发布时间】:2020-03-27 19:53:07
【问题描述】:
Half page browser Full page browser
嗨,需要你们帮助我的程序。当我使用全屏浏览器时,如何将我的机器人放置在与“半页浏览器”相同的位置。当我打开全屏浏览器时,机器人的位置移动了。
请指导我。
下面是我的网页编码:
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
body {
height: 100%;
width: 100%;
background-image: url('TPHRG floorplan1.png');
background-repeat: no-repeat;
background-attachment: fixed;
background-size: contain;
}
</style>
<body>
<img id="robot" style="position: fixed; top:200px; left:450px; border-radius: 50%; width:50px; height:60px" src="pic_8.PNG">
<?php
?>
</body>
</html>
【问题讨论】:
-
不要使用固定像素,使用相对单位,如 %。