使用视口不能完全渲染背景颜色?

时间:2012-10-26 09:10:16

标签: iphone html css

这是我的代码:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta name='viewport' content='width=device-width; initial-scale=1; maximum-scale=1; user-scalable=1;' />
    <title>Example</title>
</head>
<body>
    <style type="text/css">
        body
        {
            margin:0;
            padding:0;
        }

        #main
        {
            position:relative;
            background-color:#454a4b;
        }    


        #inside
        {
            width:900px;
            position:relative;
        }    
    </style>

    <div id="main">
        <div id="inside">
            Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature
        </div>
    </div>
</body>
</html>

如果我在iPhone上观看,背景颜色仅在页面加载时查看的空间上呈现。如果我向右滚动,我会看到没有拍摄背景。

为什么呢?我该如何解决?

0 个答案:

没有答案