1

I'm trying to extend the background colour in a table head beyond the bounds of the table. I've got it to work on the left side using th:first-child::before. I expect th:last-child::after to have mirrored behaviour, but it doesn't appear to do that.

I currently use float to take the ::before/::after out of the normal flow because th::before,th::after { position:absolute; top:0; } seems to consider body to be its parent instead of tr or thead.

jsfiddle

4

1 回答 1

3

使用::before而不是::after最后一个th怎么样?无论如何它都是浮动的,所以你使用哪一端并不重要。

像这样:http: //jsfiddle.net/xrUcb/8/

于 2013-08-29T23:52:21.957 回答