日期:2014-05-17  浏览次数:20568 次

跪求高手帮我看看这些css代码哪里出现问题了。
html代码是:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="css/css.css">
<title>模板</title>
</head>
<body>
<div class="header">header</div>
<div class="menu">
<ul>
<li><a href="#"><span>首页</span></a></li>
<li><a href="#"><span>课程学习</span></a></li>
<li><a href="#"><span>资源中心</span></a></li>
<li><a href="#"><span>巩固练习</span></a></li>
<li><a href="#"><span>帮助</span></a></li>
<li><a href="#"><span>关于我们</span></a></li>
</ul>
</div>
<div class="clear"></div>
<div class="main">
<div class="leftside">left_side</div>
<div class="content">content</div>
<div class="rightside">right_side</div>
<div class="clear"></div>
</div>
<div class="footer">footer</div>
</body>
</html>

css代码是:
body {
    margin:0;
    padding:0;
}
/*头部部分*/
.header{
width:900px;
background-color:#808080;
border:1px solid red;
height:100px;
margin:1px auto;
}
/*菜单部分*/
.menu{
width:900px;
background-color:#669933;
border:1px solid black;
height:30px;
margin:1px auto;
}
.menu ul{
    margin:0px;
    padding:0px;
display:block;
}
.menu ul li{
margin: 0;
padding: 0;
float:left;
    list-style-type:none;
height:30px;
font-weight:bold;
line-height:30px;
padding:0px 10px 0px 20px;
}
a:link{
text-decoration:none;
}
.menu ul li a span{
float:left;
display:block;
background: red;
line-height:30px;
width:80px;
}
.menu ul li a:hover span{
float:left;
display:block;
background: #49A3FF;
color:#ffffff;
}
/*中间部分*/
.main{
width:900px;
border:1px solid black;
background-color:#8080ff;
margin:0 auto;
}
.leftside{
float:left;
width:150px;
background-color:green;
border:1px solid red;
height:300px;
margin:10px 1px;
}
.content{
float:left;
width:588px;
background-color:#8080ff;
border:1px solid red;
height:430px;
margin:1px 1px;
}
.rightside{
float:left;
width:150px;
background-color:#228080;
border:1px solid red;
height:200px;
margin:10px 1px;
}
/*底部部分*/
.footer{
width:900px;
background-color:blue;
border:1px solid red;
height:50px;
margin:1px auto;
}
.clear{
clear:both;
}


我想要的效果是:每一个菜单的背景图是一张图片,当鼠标移到菜单的时候,背景图替换成另外一张图片。
不知道为什么我这些代码只能替换颜色,不能替换图片,我已经尝试了background:url("1.png")属性,但是这个属性失灵了,不知道为什么。