这个很难解释。我有一个在页面上有固定对象的网站。在大多数情况下,这会很好,但现在使用移动设备会产生问题。每当有人放大网站时,固定对象就会变得不合时宜。
有没有办法让对象在水平基础上移动,同时被锁定在屏幕上的垂直位置?
对象 CSS
#sidebar{
width: 250px;
height: 325px;
background: url(../../uploads/SRTWeert/sidebar.png) no-repeat 50px 45px;
position: fixed;
}
的HTML
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
</head>
<body>
<div id="bg">
<img src="uploads/SRTWeert/background.png" alt="background" id="background">
</div>
<div id="contentBlock">
<div id="sidebar"></div>
<div id="main"></div>
</div>
</body>
</html>