我正在尝试创建一个带有居中背景图像的页面并使用位置中心。但是,不是在垂直和水平方向上居中显示,图像看起来会垂直延伸到页面顶部以外。我在哪里/为什么会出错?背景图像位置,中心不工作
<!DOCTYPE html>
<html>
<style>
body
{
background-image:url('tumbleweed.jpg');
background-repeat:no-repeat;
background-position:center center;
background-color:#EAEAEA;
}
</style>
</html>
似乎在这里工作很好http://jsfiddle.net/rtw7h3ys/ – Akshay 2014-11-05 15:25:23