css #CSS:如何使用CSS获得第二个或第三个孩子

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了css #CSS:如何使用CSS获得第二个或第三个孩子相关的知识,希望对你有一定的参考价值。

/* For IE 7 & 8 (and other browsers without CSS3 support not including IE6) you can use the following to get the 2nd and 3rd children: */
/* 2nd Child: */
td:first-child + td

/* 3rd Child: */
td:first-child + td + td
/* Then simply add another + td for each additional child you wish to select. */

/* For IE9+ and modern browsers */
/* for the second td */
td:nth-child(2) {
}

/* for the third td */
td:nth-child(3) {
}

/* via: http://stackoverflow.com/questions/5664773/how-can-i-get-the-second-child-using-css */

以上是关于css #CSS:如何使用CSS获得第二个或第三个孩子的主要内容,如果未能解决你的问题,请参考以下文章