IE显示正常,火狐Firefox显示错误,请帮忙看下谢谢
代码如下IE显示正常
但用火狐,菜单栏就会缺少右边一块,大概一半的样子无法显示图片。
不知道错在那里了,请大家帮忙看一看啊,谢谢了
<STYLE type=text/css>
A {
COLOR: #222222; TEXT-DECORATION: none
}
A:hover {
COLOR: #ff0000; TEXT-DECORATION: underline
}
.navping A {
PADDING-LEFT: 47px; FONT-SIZE: 14px; BACKGROUND: url(t_23.jpg) no-repeat; WIDTH: 220px; COLOR: #333333; PADDING-TOP: 5px; FONT-FAMILY: Times New Roman,Verdana, Arial, Helvetica, sans-serif; HEIGHT: 30px
}
.navping A:hover {
PADDING-LEFT: 47px; FONT-SIZE: 14px; BACKGROUND: url(t_24.jpg) no-repeat; WIDTH: 220px; COLOR: #680000; PADDING-TOP: 5px; FONT-FAMILY: Times New Roman,Verdana, Arial, Helvetica, sans-serif; HEIGHT: 30px; TEXT-DECORATION: none
}
</STYLE>
<table width="220" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30" class="navping"><a href="index.html">主页</a></td>
</tr>
<tr>
<td height="30" class="navping"><a href="register.php">注册</a></td>
</tr>
<tr>
<td height="30" class="navping"><a href="login.php">登陆</a></td>
</tr>
</table>
------解决方案--------------------
firefox下a默认display是inline的,设置with,height无用,所以右边没有内容
加上xhtml申明,设置display:block
HTML code
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<STYLE type=text/css>
A {
COLOR: #222222; TEXT-DECORATION: none
}
A:hover {
COLOR: #ff0000; TEXT-DECORATION: underline
}
.navping A {
PADDING-LEFT: 47px;display:block; FONT-SIZE: 14px;BACKGROUND: url(t_23.jpg) no-repeat; WIDTH: 173px; COLOR: #333333; PADDING-TOP: 5px; FONT-FAMILY: Times New Roman,Verdana, Arial, Helvetica, sans-serif; HEIGHT: 30px
}
.navping A:hover {
BACKGROUND: url(t_24.jpg) no-repeat;COLOR: #680000; TEXT-DECORATION: none
}
</STYLE>
<table width="220" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="30" class="navping"><a href="index.html">主页</a></td>
</tr>
<tr>
<td height="30" class="navping"><a href="register.php">注册</a></td>
</tr>
<tr>
<td height="30" class="navping"><a href="login.php">登陆</a></td>
</tr>
</table>