我是所有 css 的初学者,我反复尝试将图像(透明 png)放置在居中的表格上,但由于某种原因,图形不会从浏览器的左上角移动。绝对定位应该允许我将元素放置在我想要的任何地方。如果有人可以帮助确定我做错了什么,我将不胜感激。
---------------------------------- html-------------- ----------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Welcome to Knock on Wood Productions!<title>
<link rel="stylesheet" type="text/css" href="css/style.css" media="all" />
</head>
<body>
<div id="branch">
</div>
<table width="803" border="0" cellpading="0" cellspacing="0" align="center">
<tr>
<!-- The 1st nested table starts here. -->
<td width="355" height="180" background= "images/grn1.png">
</td>
<td width="10" height="180" background= "images/grn2.png"></td>
<td width="438" height="180" background= "images/grn3.png"></td>
</tr>
</table>
</body>
</head>
------------------------------------ CSS ------------- ----------------------
body { background-color: #fff8a7;
}
#wrapper { position: absolute; width: 803;
margin-left: auto ;
margin-right: auto ;
}
#branch { position: absolute; width: 548;
top: 60;
left: 50;
/* background-image: url(images/gbranch.png); */
z-index: 2;
}
td { border: solid thin red;