2012-09-09 51 views
0

我一直在基于模板处理一些CSS。不是我的选择,但这是我的。未记录的CSS属性

在清理CSS的过程中(有人使用CSS美化器对其进行分栏,使其成为主要的PITA来编写),我遇到了一个完全无法解释的CSS属性:nowhitespace

在我的文件中,它显示为nowhitespace: afterproperty;,并且通常在单个规则中重复多次。在网络拖网之后,我发现这个神秘的属性出现在样式表的左侧和右侧,但从来没有对它做什么或者作者认为它做了什么解释。

所以,我呼吁你,Stackoverflow社区,请解释这个属性的起源,据我所知,完全没有什么,并且没有已知的浏览器识别。

下面是从文档我有,片断美化后:

ul.nav a, ul.nav a:visited { 
    /* grouping these selectors makes sure that your links 
    retain their button look even after being visited */ 
    padding: 5px 5px 5px 15px; 
    nowhitespace: afterproperty; 
    nowhitespace: afterproperty; 
    nowhitespace: afterproperty; 
    nowhitespace: afterproperty; 
    nowhitespace: afterproperty; 
    nowhitespace: afterproperty; 
    display: block; /* this gives the link block properties 
    causing it to fill the whole LI containing it. This 
    causes the entire area to react to a mouse click. */ 
    width: 160px; /*this width makes the entire button 
    clickable for IE6. If you don't need to support IE6, 
    it can be removed. Calculate the proper width by 
    subtracting the padding on this link from the width 
    of your sidebar container. */ 
    text-decoration: none; 
    background-color: #C6D580; 
} 

寻求评论的文字后,我相信这个CSS模板的起源是一个通用的Dreamweaver模板。 Here。我想知道我的特定版本来自哪里。

+0

谁写的CSS代码? –

+1

“*拖网后,我发现这个神秘的财产出现在样式表的左侧和右侧*” - 请提供指向样式表的链接。 –

+0

没有必要为''nowhitespace''''''afterproperty''创建标签,因为它们太具体。 – yadutaf

回答

5

nowhitespace在任何主要浏览器中都不是有效的CSS属性。如果您尝试它,您将在该浏览器的控制台窗口中看到错误或警告。

火狐给了我,当我尝试它的jsfiddle此错误:

时间戳:2012-09-09 1时06分10秒

警告:未知属性 'nowhitespace'。声明下降了。

源文件:http://fiddle.jshell.net/_display/ 线:14

当我谷歌,我发现使用该名称的几个样式,但作为一个类名,而不是一个性质。有人可能在不知道它是什么的情况下复制它(即货物崇拜编程)。

+0

请参阅[第203-205行](https://gist.github.com/1630045)。如果你用Google搜索整个'nowhitespace:afterproperty;',似乎还有其他的。 –

+0

[Here's another。](http://code.google.com/p/lightblog/source/browse/trunk/admin/style/new/create.css?r=562&spec=svn564#36) –

+0

我发现甚至更多。要点是,他们在野外。在搜索结果没有解释之后,我想到了货物崇拜节目,并且问了这个问题来得到最终结论,甚至可能是这个愚蠢的源头。 – Dakota

4

此代码悄悄进入通过工具“ProCSSor”处理的样式表。

我怀疑这是一段内部代码,它决定了CSS应该如何重写,因为一个简单的英语阅读“属性之后没有空白”似乎指的是样式表中属性的格式,而不是渲染在网页上的元素。

因此,我建议这是一个软件中的错误。我有reported it on their Twitter feed,所以希望它能在未来的版本中得到解决。