html – 为什么不允许使用样式表列?

W3 specifies表格列(包括< col>元素)只允许四个CSS规则 – 边框,背景,宽度和可见性。

有人知道这个决定背后的原因吗?如果你可以拥有边框和背景,为什么不是字体和颜色?

解决方法

Ian Hixie在这里详细解释: The mystery of why only four properties apply to table columns.相关报价:

The colour of text is dependent on the ‘color’ property of its element. Unless specified,the ‘color’ property (basically) defaults to ‘inherit’,which means “take the value of the parent element”.

So for some text in a cell,the colour is determined by the ‘color’ property of the cell,which is taken from the row,which is taken from the table,which is taken from the table’s parent,and so on.

What about the column? Well,the column isn’t one of the cell’s ancestors,so it never gets a look-in! And therein lies the problem.

相关文章

vue阻止冒泡事件 阻止点击事件的执行 &lt;div @click=&a...
尝试过使用网友说的API接口获取 找到的都是失效了 暂时就使用...
后台我拿的数据是这样的格式: [ {id:1 , parentId: 0, name:...
JAVA下载文件防重复点击,防止多次下载请求,Cookie方式快速简...
Mip是什么意思以及作用有哪些