我正在嘗試創建一個帶有居中背景圖像的頁面並使用位置中心。但是,不是在垂直和水平方向上居中顯示,圖像看起來會垂直延伸到頁面頂部以外。我在哪裏/爲什麼會出錯?背景圖像位置,中心不工作
<!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