html 里怎样给一行文字加链接的同时,鼠标经过的时候文字和背景都变色,代码如下
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title><style>.a{ background:#3f8cd2; }.table td a:hover{ background:#000000; color:#d23f3f;}</style></head>
<body><table width="964" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="226" height="38" align="center"><a href="http://www.sqmkyy.com/news/class/?86.html" target=_blank><span style="color:#fff">公司简介</span></a></td> <td width="20"> </td> <td width="226" align="center"><a href="http://www.sqmkyy.com/news/class/?87.html" target=_blank><span style="color:#fff">企业文化</span></a></td> <td width="20"> </td> <td align="center"><a href="http://www.sqmkyy.com/news/class/?85.html" target=_blank><span style="color:#fff">企业定位</span></a></td> <td width="20"> </td> <td width="226" align="center"><a href="http://www.sqmkyy.com/news/class/?85.html" target=_blank><span style="color:#fff">联系我们</span></a></td> </tr></table></body></html> 展开
<body><table width="964" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="226" height="38" align="center"><a href="http://www.sqmkyy.com/news/class/?86.html" target=_blank><span style="color:#fff">公司简介</span></a></td> <td width="20"> </td> <td width="226" align="center"><a href="http://www.sqmkyy.com/news/class/?87.html" target=_blank><span style="color:#fff">企业文化</span></a></td> <td width="20"> </td> <td align="center"><a href="http://www.sqmkyy.com/news/class/?85.html" target=_blank><span style="color:#fff">企业定位</span></a></td> <td width="20"> </td> <td width="226" align="center"><a href="http://www.sqmkyy.com/news/class/?85.html" target=_blank><span style="color:#fff">联系我们</span></a></td> </tr></table></body></html> 展开
2个回答
2015-03-18
展开全部
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
.index{ background:#3f8cd2; }
.index a{ background:#000000; color:#FFFFFF; text-decoration:none;}
.index a:hover{ background:#00FF66; color:#FF0000;}
</style>
</head>
<body>
<table width="964" border="0" cellpadding="0" cellspacing="0">
<tr class="index">
<td width="226" height="38" align="center"><a href="http://www.sqmkyy.com/news/class/?86.html" target=_blank>公司简介</a></td>
<td width="20"> </td>
<td width="226" align="center"><a href="http://www.sqmkyy.com/news/class/?87.html" target=_blank>企业文化</a></td>
<td width="20"> </td>
<td align="center"><a href="http://www.sqmkyy.com/news/class/?85.html" target=_blank>企业定位</a></td>
<td width="20"> </td>
<td width="226" align="center"><a href="http://www.sqmkyy.com/news/class/?85.html" target=_blank>联系我们</a></td>
</tr>
</table>
</body>
</html>
不懂可以追问我。。。。。
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style>
.index{ background:#3f8cd2; }
.index a{ background:#000000; color:#FFFFFF; text-decoration:none;}
.index a:hover{ background:#00FF66; color:#FF0000;}
</style>
</head>
<body>
<table width="964" border="0" cellpadding="0" cellspacing="0">
<tr class="index">
<td width="226" height="38" align="center"><a href="http://www.sqmkyy.com/news/class/?86.html" target=_blank>公司简介</a></td>
<td width="20"> </td>
<td width="226" align="center"><a href="http://www.sqmkyy.com/news/class/?87.html" target=_blank>企业文化</a></td>
<td width="20"> </td>
<td align="center"><a href="http://www.sqmkyy.com/news/class/?85.html" target=_blank>企业定位</a></td>
<td width="20"> </td>
<td width="226" align="center"><a href="http://www.sqmkyy.com/news/class/?85.html" target=_blank>联系我们</a></td>
</tr>
</table>
</body>
</html>
不懂可以追问我。。。。。
2015-03-18 · 知道合伙人互联网行家
关注
展开全部
td:hover{
background:XXXX
}
td:hover a{
color:XXXX
}
background:XXXX
}
td:hover a{
color:XXXX
}
追答
其实你这个是个导航吧 完全可以用
<ul>
<li><a href="#">公司简介</a></li>
<li><a href="#">企业文化</a></li>
<li><a href="#">企业定位</a></li>
<li><a href="#">联系我们</a></li>
</ul>
li a:hover{
background:#FFF;
color:#369
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询