2017-03-24 92 views
0

如何去除角落中的颜色?修复背景颜色

body { 
border: 30px solid #fff; 
border-radius: 50px; 
background-color: blue; 
background-attachment: fixed; 
position: fixed; 
width: 100%; 
height: 100% 

}

enter image description here

+1

请创建工作片段,使我们ç请参阅完整的代码。 –

回答

3

在你的HTML身体有以下几点:

<body> 
<div> 
    <!-- all other body html here --> 
</div> 
</body> 

然后在你的CSS使用:

body { 
    position: fixed; 
    width: 100%; 
    height: 100% 
} 
body > div { 
    height: 100%; 
    width: 100%; 
    background: blue; 
    border: 30px solid #fff; 
    border-radius: 50px; 
} 

的jsfiddle:https://jsfiddle.net/d7bd5fjm/

+0

感谢您的帮助 –

0

你可以增加边框像素大小,它会掩盖角落

+0

我不明白,请用代码显示? –

0

您应该添加一个额外的div标签,并添加背景颜色了,而不是在身体标签。

+0

我不明白,请用代码显示? –

0

TRY,

body { 
     border: 20px solid #fff; 
     border-radius: 50px; 
     background-color: blue; 
     background-attachment: fixed; 
     position: fixed; 
     margin: -15px; //Pulling the border outwards. 
     width: 100%; 
     height: 100% 
    } 
+0

没有区别。 –

+0

现在怎么样? @BatuhanAkkaya – DeeJay

0

而不是将它设置在body,为什么不设置一个新的元素,像div什么?但是,如果你坚持要保持它在身上,设置白上html是这样做的一种方式......

html { 
    background: white;} 
+0

谢谢。如果问题出在身体上,我可以使用div。 –