问题描述
我遇到的唯一支持
< colgroup>< col class =" behold">< / colgroup>
的浏览器申请了CSS样式到整列,是Microsoft Internet
资源管理器。我被告知它不应该这样做,因为这不是规范的一部分。
如何将样式应用于整个列?当然你没有
来写每一行上的
< td class =" behold"
>
-
Roedy Green加拿大心灵产品
Java词汇表
The only browser I have encountered that supports
<colgroup><col class="behold"></colgroup>
to apply a CSS style to a whole column, is Microsoft Internet
Explorer. I have been told it SHOULD NOT do so, since this is not
part of the specification.
How then to you apply styles to entire columns? Surely you don''t have
to write
<td class="behold"on every row item.
--
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
推荐答案
参见,您可以将
属性边框,背景,宽度和可见性应用于列和
列组。所以
col.behold {
background-color:lightblue;
}
应该这样做。
-
Martin Honnen
See http://www.w3.org/TR/CSS21/tables.html#columns, you can apply the
properties border, background, width, and visibility to columns and
column groups. So
col.behold {
background-color: lightblue;
}
should do.
--
Martin Honnen
http://JavaScript.FAQTs.com/
对,虽然这是一个棘手且令人困惑的问题。
Right, though this is a tricky and confusing issue.
如果你想覆盖全部,你肯定有。浏览器。但你可以通过结合两个
策略覆盖几乎所有支持CSS的浏览器:
a)使用< colapproach覆盖IE
b)使用上下文选择器来涵盖符合标准的浏览器;例如
td:first-child + td + td {...}
是一种为第3列分配样式的方法,包含
仅限
td单元格。
-
Jukka K. Korpela(Yucca)
Surely you have, if you wish to cover "all" browsers. But you can cover
virtually all significant CSS-enabled browsers by combining two
strategies:
a) use the <colapproach to cover IE
b) use contextual selectors to cover standards-conforming browsers; e.g.
td:first-child + td + td { ... }
is a way of assigning a style to the 3rd column, for rows that contain
td cells only.
--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/
我的问题更多的是关于有效地将样式应用于整个列的标记的好处,希望在单行中,因为合理的
< colgroup>< col style =" behold"似乎不起作用。
我想你会指向一个实现的样式表/ html页面
w3 URL谈论的一些功能。我的大脑似乎比一些例子更好地推广,而不是阅读
律师语言空间。一旦我从看到一些
的例子中得到了一般的想法,那么规格对于收集细节更有意义。
-
Roedy Green加拿大心灵产品
Java词汇表
这篇关于< colgroup>< col class =" behold">< / colgroup>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!