HTML5.我在将菜单标题与 ul 背景匹配时遇到问题



正如我在标题中所说,我正在尝试将菜单标题(一张图片)与背景图片与菜单标题匹配的ul进行匹配。无论我尝试了什么,头球和ul之间仍然有差距。如果我听起来很困惑,很抱歉,这是代码:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<style>
ul {
margin: 0;
padding: 10px 0px 25px 45px;
background:url(ul.png) no-repeat 0 100%;
list-style-image:url(li.png);
}
table td { 
display: table-cell;
vertical-align: top; 
}
ul li a:hover{
color: red;
padding-left: 10px;
}
img {
position: relative;
}
</style>
</head>
<body>
<table width="313" border="0">
<tr>
<td width="303" height="257"><img src="h3.png" width="224" height="35"  alt=""/><ul>
<li><a href="#">Future</a></li>
<li><a href="#">Health</a></li>
<li><a href="#">Life</a></li>
<li><a href="#">Money</a></li>
<li><a href="#">Personal</a></li>
<li><a href="#">Phobias</a></li>
</ul></td>
</tr>
</table>
</body>
</html>

要避免所有这些"间隙问题",请考虑包含Eric A.制作的reset.css样式表

您可以在此处获取-->http://meyerweb.com/eric/tools/css/reset/reset.css

<style>之前写入:

<link rel="stylesheet" type="text/css" media="screen" href="YOUR_PATH/css/reset.css" />

最新更新