2011-09-28 32 views
0

。这是怎么回事?由于某些原因,我的链接不符合我的课程,因此链接未上课

.greyBoxTxt { 
    font-family:Verdana, Arial, Helvetica, sans-serif; 
    font-size:11px; 
    color:#7b7d7e; 
} 

a.greyBoxTxt { 
    color:#0164a5; 
    text-decoration:none; 
} 

<table width="100%" border="0" cellspacing="0" cellpadding="0"> 
    <tr> 
     <td width="25%" valign="top" class="greyBoxTxt"> 
      <b>Business Banking</b><br /> 
      <a href="#">eBusiness Checking</a><br /> 
      <a href="#">Business Checking</a><br /> 
      <a href="#">Commercial Checking</a><br /> 
      <a href="#">Non-Profit Checking</a><br /> 
      <a href="#">Business Savings</a><br /> 
      <a href="#">More... 
     </a></td> 
     <td width="25%" valign="top">&nbsp;</td>   <td width="25%" valign="top">&nbsp;</td> 
     <td width="25%" valign="top">&nbsp;</td> 
    </tr> 
</table> 
+3

使用'.greyBoxTxt了' –

回答

1

你的选择是错误的:a.greyBoxTxt目标类名为greyBoxTxt的锚元素。喜欢的东西thie:

<a class="greyBoxTxt" href="#">Lorem</a> 

你需要的是一个锚元素,它的元素与类名greyBoxTxt后代:

.greyBoxTxt a { 
    /* ... */ 
} 

注意,在这个新的选择,在.greyBoxTxt和之间的空间a实际上是descendant combinator

+0

这样做: greyBoxTxt一个{ \t颜色:#0164a5; \t text-decoration:none; } 仍然没有去 – Damien

+0

你错过了'.greyBoxTxt a'这个时期 - 这个时期是[类名选择器](http://www.w3.org/TR/CSS2/selector.html#class- HTML)。 –

+0

太棒了!这种事很愚蠢,但我总是遇到麻烦。我会一直诉诸内联样式。我想这次,我会问。太感谢了! – Damien

2

我猜你正在试图做的是更本

.greyBoxTxt { 
    font-family:Verdana, Arial, Helvetica, sans-serif; 
    font-size:11px; 
    color:#7b7d7e; 
} 

.greyBoxTxt a { 
    color:#0164a5; 
    text-decoration:none; 
} 

<table width="100%" border="0" cellspacing="0" cellpadding="0"> 
    <tr> 
     <td width="25%" valign="top" class="greyBoxTxt"> 
      <b>Business Banking</b><br /> 
      <a href="#">eBusiness Checking</a><br /> 
      <a href="#">Business Checking</a><br /> 
      <a href="#">Commercial Checking</a><br /> 
      <a href="#">Non-Profit Checking</a><br /> 
      <a href="#">Business Savings</a><br /> 
      <a href="#">More... 
     </a></td> 
     <td width="25%" valign="top">&nbsp;</td>   <td width="25%" valign="top">&nbsp;</td> 
     <td width="25%" valign="top">&nbsp;</td> 
    </tr> 
</table> 

的选择a.greyBoxTxt会选择这样的事情,商业检查

+0

这样做: greyBoxTxt一个{ \t颜色:#0164a5; \t text-decoration:none; } 仍然没有去 – Damien

相关问题