2016-01-21 93 views
0

我有一個包含表的div元素。我需要將除第一行以外的所有行的高度設置爲固定數字。此外,我需要所有列的內部文本設置爲特定的大小,除了第一行:如何使用css引用除第一個以外的所有行

這是一個html我:

<style> 
    #divFileSet 
    { 
     border:0px solid gray; 
     position:absolute; 
     top:170px; 
     left:170px; 
     overflow:visible;width:1020px;height:450px; 

    } 
</style> 

這是HTML部分:

<div id="divFileSet" > 
    <table cellspacing ="3px"; cellpadding="3px" style="border:1px solid gray;"> 
     <tr> 
      <td colspan="2" style="font-size:large; color:white; background-color:#005482;"> 
      <span>File Status:</span> 
      </td> 
     </tr> 
     <tr> 
      <td></td> 
      <td><a href="...">Session 1</a></td><br/> 
     </tr> 
     <tr> 
      <td></td> 
      <td><a href="..."> Session 2</a></td><br/> 
     </tr> 
     <tr> 
      <td></td> 
      <td><a href="...">Session 3</a></td><br /> 
     </tr>    
    </table> 
    </div> 

html生成如下所示的內容:

enter image description here

我需要爲2 - 4行設置高度和文本。

我該如何使用css

回答

1

您可以使用:not(:first-child)

div table tr:not(:first-child) { 

} 
+0

哦哇!刪除了我的答案。 ':D' –

0

一個甚至IE7兼容版本將是:

tr + tr { 
    /* styles */ 
} 

當然,但是這一次是不是真的很美。

相關問題