這裏是我的CSS:CSS背景位置並不適用於我的課
.header
{
background-image:url(Images/head.png);
background-position: center top;
background-repeat:no-repeat;
width:1010px;
height:269px;
}
這是我的HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>xSky Software - Most likely the only software on Clickbank that exists.</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="header"></div>
</div>
</body>
</html>
我試圖讓我的形象在X軸爲中心,並在Y軸上重疊。但是我的CSS類.header
不會那樣做。你能看到我做錯了什麼嗎?
編輯:打開頂部中心周圍無法正常工作或
所以'.header'圖像顯示,只是不保持中心? – Marcel 2011-05-22 11:46:18
@Marcel正確 – Jeff 2011-05-22 11:49:55