未记录的CSS属性

时间:2012-09-09 00:02:34

标签: css properties

我一直在研究一些基于模板的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。我想知道我的特定版本来自哪里。

2 个答案:

答案 0 :(得分:5)

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

当我在jsfiddle中尝试时,Firefox给了我这个错误:

  

时间戳:2012-09-09 01:06:10

     

警告:未知属性'nowhitespace'。声明被撤销。

     

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

当我谷歌它时,我找到一些使用该名称的样式表,但作为类名,而不是作为属性。有可能有人在不知道它是什么的情况下复制它(即货物崇拜节目)。

答案 1 :(得分:4)

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

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

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

相关问题