我有一些用于调整表格样式的CSS。
这是它:
.editor td:first-child
{
width: 150px;
}
.editor td:last-child input,
.editor td:last-child textarea
{
width: 500px;
padding: 3px 5px 5px 5px;
border: 1px solid #CCC;
}
它适用于Firefox、Safari和Chrome,但目前不支持IE8。
我知道问题源自于first-child和last-child,但我不是专家。
有什么想法可以修复它吗?
PS:我在HTML文档顶部添加了<!doctype html>
,但没有改变任何东西。
:last-child
选择器(尽管我认为它支持:first-child
,因为这在CSS 2.1规范中有提到,而:last-child
在CSS 3中才被引入)。 - James Allardice