2011-09-28 53 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