vs2005中使用css的问题

来源:百度知道 编辑:UC知道 时间:2024/06/24 06:48:54
在网页中使用<li><a href="****" class="nav">home</a></li>
CSS中为
a.nav:link, a.nav:visited {
display:block; float:left; padding:0px; margin-right:8px;width:61px; height:61px; text-align:center; font-weight:bold; font-size:12px; line-height:61px;
text-decoration:none; color: #fff; background:url(images/bt_bg.gif) no-repeat center;}

a.nav:hover {
display:block; float:left; padding:0px; margin-right:8px;width:61px; height:61px; text-align:center; font-weight:bold; font-size:12px; line-height:61px;
text-decoration:none; color: #fff; background:url(images/bt_bg_a.gif) no-repeat center;}
但是用其他却没效果连字也是白色的
本来应该是鼠标移动到home上时 会出现图片的变化
不好意思 原来是css中的图片路径错了
都没答对喔

.nav{display:block; float:left; padding:0px; margin-right:8px;width:61px; height:61px; text-align:center; font-weight:bold; font-size:12px; line-height:61px;
text-decoration:none; color: #fff; background:url(images/bt_bg.gif) no-repeat center;}
.nav:hover{ background:url(images/bt_bg_a.gif) no-repeat center;}

试试我这个吧

在网页中使用<li class="nav"><a href="****">home</a></li>
.nav a{
display:block; float:left; padding:0px; margin-right:8px;width:61px; height:61px; text-align:center; font-weight:bold; font-size:12px; line-height:61px;
text-decoration:none; color: #fff; background:url(images/bt_bg.gif) no-repeat center;}

.nav a:hover {
display:block; float:left; padding:0px; margin-right:8px;width:61px; height:61px; text-align:center; font-weight:bold; font-size:12px; line-height:61px;
text-decoration:none; color: #fff; background:url(images/bt_bg_a.gif) no-repeat center;}

a .nav{...