我做了一些UI练习,并且背景图像与身体标记有问题。图像水平溢出,我想摆脱这一点。 Plz帮助我。身体背景溢出
代码我试图修复它。
<style type="text/css">
body {
background: url("public/res/bg(WT).png") no-repeat fixed center center;
background-size: cover;
}
</style>
问题说明:(红色框)
我完整的代码是一样
<html>
<head>
<style>
* { margin:0; padding:0; }
body {
background: url("public/res/bg(WT).png") no-repeat fixed center center;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
</style>
</head>
<body>
//contents are here
</body>
</html>
你可以把这个在plunkr?所以我们可以调试。因为到目前为止,我看到你的形象的问题。 CSS看起来不错。 – Smit
乍一看,它看起来问题不是来自背景图像,而是来自一些边缘 – Weedoze
我为所有标记0做了边距和填充。@Weedoze –