身体背景溢出

时间:2017-02-27 07:43:53

标签: html css

我做了一些UI练习,背景图像到body标签有问题。图像水平溢出,我想摆脱它。 Plz帮助我。

代码我试图修复它。

for row in tup1:  
    print(row[0])

问题说明:(红色框)

enter image description here

我的完整代码就像

<style type="text/css">
        body {
            background: url("public/res/bg(WT).png") no-repeat fixed center center;
            background-size: cover;
        }
    </style>

2 个答案:

答案 0 :(得分:0)

使用<body>div下的整个内容打包并为其应用overflow: hidden

.wrapper {
  overflow: hidden;
}

https://i.imgur.com/gPpaxlH.png以此为参考。我已经包装了除脚本和div之外的所有东西,因为我认为这是用JS生成的。从overflow-x

中删除<body>

在任何项目中,请遵循此规则。

答案 1 :(得分:0)

试试这个

&#13;
&#13;
* { margin:0; padding:0; }
body {
            background-image: url("http://unsplash.it/2500/1000");
            -webkit-background-size: cover;
            -moz-background-size: cover;
            -o-background-size: cover;
            background-size: cover;
            background-position:center;
            background-attachment: fixed;
           
        }
&#13;
<body>

</body>
&#13;
&#13;
&#13;

相关问题