开发者

Set border on first table row, w/o using a ID or class

开发者 https://www.devze.com 2022-12-24 05:32 出处:网络
I am trying to style a web app that we don\'t have the source code too. So I drilled down into the DOM, but right now the bottom border is being set on ALL the rows, I need onl开发者_如何学运维y the

I am trying to style a web app that we don't have the source code too.

So I drilled down into the DOM, but right now the bottom border is being set on ALL the rows, I need onl开发者_如何学运维y the first row.

#tableID tbody tr td table tbody tr
{
  border-bottom: solid 1px #cccccc; 
}

Is this possible?


If you don't care about supporting IE6:

#tableID tbody tr td table tbody:first-child
{
  border-bottom: solid 1px #cccccc;
}


#tableID tbody tr td table tbody tr:first-child { }

Should select the first chidld according to the CSS 2 selector specification.

See here for some information which browsers select the selectors.

0

精彩评论

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

关注公众号