1
我正在创建一个需要在中间居中的圆形网站。背景由围绕中心图像的圆圈组成。每当我以全屏模式(F11快捷方式)查看我的站点时,无论我的屏幕分辨率如何,它都完美居中。屏幕分辨率。全屏 - 完美。正常屏幕 - 不完美
如果我在没有全屏的情况下查看我的网站,我的屏幕分辨率会稍微调整背景,使其不能完美居中。
对于我的背景,我有这样的代码:
* {
padding:0; margin:0;
}
html, body {
height:100%;
width: 100%;
display: block;
background-color: #1a1207;
/* add font here */
color: white;
}
body{
background-image:url('../img/background.jpg');
background-position: left;
background-repeat: no-repeat;
background-attachment: scroll;
-webkit-background-size: cover;
-moz-background-size: cover;
-moz-background-position: fixed;
-o-background-size: cover;
background-size: cover;
}
有什么办法解决呢?
这不是自动使它:中心(因此居中?) – nlreturns
是不是你想要的?或者你可能需要这样的东西:background-position:center top; –
啊,是的,我以为我有这个(是在早期版本)。但问题依然存在。 – nlreturns