0

我在外部 css 文件中为 table、tr、td 定义了一个通用 css 样式,如下所示 -

table,tr,td {font: 12px Arial;}

我在具有#id 的div 中有表,我想在该#id 内为表、tr、td 应用不同的(内联)css 样式。我正在尝试如下 -

#id table,tr,td{font:11px Arial;}

但是如果我按照上面的方法为具有#id的div内的表添加内联css,外部表也继承了内联css,这是我不想要的吗?我如何仅对 div 内的表格应用 css 样式?

4

1 回答 1

0
#id table, #id tr, #id td {
    font:11px Arial;
}
于 2011-02-01T06:30:43.577 回答