开发者

Styling multiple tables problem

I'm trying to style the tables on my page. The first to tables went perfect without any problems. Now i'm trying to style the third table and I gave it a custom class but yet also seems to apply the styles from another table.

I'm using 3 rows and 6 columns. HTML:

<table class="videos">
<tr>
<td>
Content
</td>
</tr>
</table>

CSS:

<--- part of another table --->
    td:nth-child(4) {
        padding-right:25px;} 
<--- part of another table --->

table.videos {
    width:940px;}

table.videos td {
    border-bottom:1px solid #333;
    padding-top:13px;}

So I want to style the table videos but the class td:nth-child(4) overrules somehow the td 开发者_JS百科class of videos. Using padding-right:0px; on table.videos td doesnt work...

Anyone any sugestions? Thnx in advance!


styling for td:nth-child applies to all tables. you should give every table an own class, like you did for videos, and to work around this change the other css rules to be like:

.firsttable td:nth-child(4){
  /*something*/
}

.videos{
  /*something else*/
}

.videos td{
  /*something else*/
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜