`column-span:`发生了什么
在寻找此功能时,我遇到了 2001 年草案,其中指定将 column-span
定义为 none |全部 | <整数> |继承。我没有得到
none
(不跨越任何列?这是否意味着display:none
‽),但除此之外,它很好。它甚至还附有这张有用的图片。
代码是某事。大致如下:
article { column-count: 3 }
h1 { column-span: all }
h2 { column-span: 2 }
一点历史:它于 2005 年被废除。2007 年,它被重新引入,值为 1 |全部
,变成了none | all
2011(重新引入无意义的none
)。
我的问题:为什么这个财产被如此严重地削减?这背后有什么道理吗? (以及none
后面)
searching for this functionality, i came across the 2001 draft, which specified column-span
to be defined as none | all | <integer> | inherit
. i don’t get the none
(spans no columns? does that mean display:none
‽), but other than that, it’s nice. it even comes with this useful picture.
code is sth. along the lines of:
article { column-count: 3 }
h1 { column-span: all }
h2 { column-span: 2 }
a bit history: it was abolished in 2005. 2007, it was re-introduced with the values 1 | all
, wich became none | all
2011 (reintroducting the nonsensical none
).
my question: why was this property so badly curtailed? is there any reasoning behind that? (and behind the none
)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
至少在当前草案中,属性名称
column-span
实际上意味着“跨越几列”,值none
意味着“否”或“假”。在 2009 年 12 月草案中,情况是更自然,因此该属性可以解释为“跨越的列数”,并且初始值为1
而不是none
。一般来说,CSS 中的标识符常常具有误导性,并且可能反映规划的各个阶段 - 想想
空白
,它会影响一般换行,而不仅仅是文本或字母间距
code>,它影响所有字符,而不仅仅是字母。根据我在各种讨论中读到的内容,将值限制为仅两个(不跨越,跨越所有)的原因是实现其他值将本质上不同并且更复杂。此外,对此类功能的需求似乎比对基本功能的需求要有限得多。
这听起来很现实,特别是因为即使是非常基本的多列布局的支持也很差:我认为没有任何主要浏览器在建议的标准名称下支持它(但有些浏览器在特定于浏览器的属性名称下支持它),并且有即使对任何名称下的
column-span: all
似乎也没有任何支持。 (有传言说 Safari 支持它,但我在 Win 7 版本上的测试并未证实这一点。)In the current draft at least, the property name
column-span
effectively means “spans several columns” and the valuenone
means “no” or “false.” In the December 2009 draft, things were more natural, so that the property could be interpreted as “number of columns spanned” and the initial value was1
and notnone
.In general, identifiers in CSS are often misleading and may reflect various stages of planning—think about
white-space
, which affects line breaking in general, not just text, orletter-spacing
, which affects all characters, not just letters.Based on what I have read in various discussions, the reason for limiting the values to just two (no spanning, spanning all) is that implementing other values would be essentially different and more complicated. Moreover, the demand for such a feature appears to be considerably more limited than for the basic functionality.
This sounds realistic, especially since even the very basic multi-column layout has so poor support: I don’t think any major browser supports it under the proposed standard names (but some support it under their browser-specific property names), and there does not seem to be any support even to
column-span: all
under any name. (Rumors say Safari supports it, but my tests on the Win 7 version don’t confirm this.)