开发者

Using selectors in css to filter out certain elements

I'm trying to get ride of the last column in each table EXCEPT for the last table on the page. Is there a way to do this in css?

Here is what I have, and it doesn't seem to be working...

table:not(:last-child) tr td:last-child {

}

If this can't be done in css, 开发者_运维问答please just let me know. :)


You may want to use table:not(:last-of-type) instead, in case there are other elements after that last table in your page:

table:not(:last-of-type) tr td:last-child {
    display: none;
}

It also depends on the browsers you're testing in. No version of IE older than 9 supports the pseudo-classes being used.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜