Here's my JSFiddle
这是我的JSFiddle
html, body {
height: 100%;
}
#background {
height: 100%;
background: url(http://phosproject.com/wp-content/themes/phos_theme/images/7.jpg); no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
.button {
position: absolute;
top: 50%;
left: 50%;
width: 440px;
height: 460px;
margin-top: -230px; /* Half the height */
margin-left: -220px; /* Half the width */
}
On my website the background seems to have a white border around it and makes it look bad and i was wondering how i could remove it.
在我的网站上,背景似乎是白色的边框,让它看起来很糟糕,我想知道怎么去掉它。
1 个解决方案
#1
0
The html body
has a default margin. You need to remove it.
html主体有一个默认的边界。你需要移除它。
body {
margin: 0;
}
更新的小提琴。
#1
0
The html body
has a default margin. You need to remove it.
html主体有一个默认的边界。你需要移除它。
body {
margin: 0;
}
更新的小提琴。