当前位置:编程学习 > html/css >>

控制TD里面链接的css样式表,其实很简单的

很多时候我们使用table比div更方便,所以有时候需要给td里面的a加上样式风格


可以通过在table标签中设置css样式以控制td内部的链接吗?
问题是:可以通过我在table标签中设置的样式style1,控制该表格中所有链接的样式吗?这个style应该怎么写

如何在TD上添加链接样式

大家把这段代码拷贝下来做个页面自己看看吧!

<style>
td a, 
td a:link{…}{font-size: 12px;color: #0028AC;text-decoration: none;line-height: 16px;}, 
td a:visited {…}{font-size: 12px;color: #0028AC;text-decoration: none;line-height: 16px;}, 
td a:active {…}{font-size: 12px;color: #0028AC;text-decoration: underline;line-height: 16px;},   
td a:hover {…}{font-size: 12px;color: #0028AC;text-decoration: underline;line-height: 16px;}
</style>
<table>
<tr>
   <td align="center" height="30">
     <a href="http://www.zhaoxi.org/">qq头像制作</a>
  </td>
</tr>
</table>

当然这里是通写td的css,你还可以给td加上 class="zzzyk" 然后单独设置 zzzyk的 样式风格,那样多个td就可以轻松处理了

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,