移动设备中心和后台失败

时间:2013-07-23 13:45:46

标签: html css mobile background center

我的页面中有一个背景和一个居中的图像。它的HTML + CSS。 它在桌面浏览器中运行良好。但是当我从Android设备打开它时,我有两个问题。

1-背景图片不适合页面。

2-我的居中图像看起来已经放大了。在纵向模式下它看起来不错但是当我将设备转到横向位置时,它不适合屏幕。我的屏幕分辨率是1280x720,我的图像尺寸是954x604。它应该适合,但它不适合。它看起来更大,无法看到图像的顶部。

有人可以帮忙吗?

Here is the test page

这是HTML:

<!DOCTYPE html>
<html lang="en">
<head>
<title>Celline - Selin Sarpkan</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="resource/styles.css">
</head>
<body>
    <div class="dispencere">
    </div>
</body>
</html>

这是CSS:

*{ margin:0; padding:0; }

body{
font-size:9px;
color:#666;
font-family:Arial, Helvetica, sans-serif;
overflow: hidden;
background-image:url('../images/paper.jpg');
background-repeat: no-repeat;
background-size:cover;}

.dispencere{
background-image:url('../images/main.png');
width:954px;
height:604px;
position:absolute;
left:50%;
top:50%;
margin:-295px 0 0 -465px;
text-align:center;}

0 个答案:

没有答案