目录
求教如何改变一个td里的label和a的字体颜色_html/css_WEB-ITnose
Jun 24, 2016 pm 12:01 PM
字体
颜色
<!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><style type="text/css">.change td:hover{ color:#56ae2e;}#table1{ border:none;width:102%;height:100%; border-style:none; margin-left:-2px;margin-top:-2px; }#table1 tr{ width:100%;height:5.5%; text-align:center;font-size:16px; }#table1 tr td:hover{ color:#56ae2e; } #table1 tr td a{ font-weight: bold; color: #2f2e2e;text-decoration: none;font-size:16px; margin-right:25%; }#table1 tr td span:hover{ color:#56ae2e; }</style><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>无标题文档</title></head><body><div id="div1" style="float:left;width:100px;height:600px;margin-top:5px;border:solid;border-color:#56ae2e;border-width:2px;"> <table id="table1" > <tr bgcolor="#56ae2e"><td> <a href="#" style="font-weight: bold; color:#FFFFFF;text-decoration: none;" >农资卖场</a></td></tr> <tr class="change"><td><a href="#" >种子</a><label>></label></td></tr> <tr class="change"><td><span id="span1"> <a href="#">农药</a><label>></label></span></td></tr> <tr><td> <a href="#">化肥</a><label>></label></td></tr> <tr><td> <a href="#">饲料</a><label>></label></td></tr> <tr><td> <a href="#">兽药</a><label>></label></td></tr> <tr><td> <a href="#">农机</a><label>></label></td></tr> </table> </div></body></html>
登录后复制
求助,怎么设置css能同时在鼠标经过的时候更改一个td里的a和label的颜色,麻烦各位大大。。
回复讨论(解决方案)
#table1 tr td:hover a{color: #f00;}#table1 tr td:hover label{color: #f00;}
登录后复制
<!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> <style type="text/css"> .change td:hover{ color:#56ae2e;} #table1{ border:none;width:102%;height:100%; border-style:none; margin-left:-2px;margin-top:-2px; } #table1 tr{ width:100%;height:5.5%; text-align:center;font-size:16px; } #table1 tr td:hover{ color:#56ae2e; } #table1 tr td:hover a{color: #f00;} #table1 tr td:hover label{color: #f00;} #table1 tr td a{ font-weight: bold; color: #2f2e2e;text-decoration: none;font-size:16px; margin-right:25%; } #table1 tr td span:hover{ color:#56ae2e; } </style> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title></head><body><div id="div1" style="float:left;width:100px;height:600px;margin-top:5px;border:solid;border-color:#56ae2e;border-width:2px;"> <table id="table1" > <tr bgcolor="#56ae2e"><td> <a href="#" style="font-weight: bold; color:#FFFFFF;text-decoration: none;" >农资卖场</a></td></tr> <tr class="change"><td><a href="#" >种子</a><label>></label></td></tr> <tr class="change"><td><span id="span1"> <a href="#">农药</a><label>></label></span></td></tr> <tr><td> <a href="#">化肥</a><label>></label></td></tr> <tr><td> <a href="#">饲料</a><label>></label></td></tr> <tr><td> <a href="#">兽药</a><label>></label></td></tr> <tr><td> <a href="#">农机</a><label>></label></td></tr> </table></div></body></html>
登录后复制
感谢!新手刚接触硬上架好苦逼啊..
感谢!新手刚接触硬上架好苦逼啊..
不客气,解决了就结贴,另外可以看一下我这个系列教程,对新手应该有帮助:
http://www.cnblogs.com/jikey/p/3613082.html
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn

热门文章
两个点博物馆:邦格荒地地点指南
4 周前
By 尊渡假赌尊渡假赌尊渡假赌
击败分裂小说需要多长时间?
3 周前
By DDD
仓库:如何复兴队友
3 周前
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
3 周前
By 尊渡假赌尊渡假赌尊渡假赌
公众号网页更新缓存难题:如何避免版本更新后旧缓存影响用户体验?
3 周前
By 王林

热门文章
两个点博物馆:邦格荒地地点指南
4 周前
By 尊渡假赌尊渡假赌尊渡假赌
击败分裂小说需要多长时间?
3 周前
By DDD
仓库:如何复兴队友
3 周前
By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒险:如何获得巨型种子
3 周前
By 尊渡假赌尊渡假赌尊渡假赌
公众号网页更新缓存难题:如何避免版本更新后旧缓存影响用户体验?
3 周前
By 王林

热门文章标签

记事本++7.3.1
好用且免费的代码编辑器

SublimeText3汉化版
中文版,非常好用

禅工作室 13.0.1
功能强大的PHP集成开发环境

Dreamweaver CS6
视觉化网页开发工具

SublimeText3 Mac版
神级代码编辑软件(SublimeText3)