I’ve been working on some CSS based on a template. Not my choice, but it’s what I’ve got.
In the process of cleaning the CSS up (someone used a CSS prettifier to columnize it, making it a major PITA to write), I’ve come across an entirely unexplained CSS property: nowhitespace.
In the document I have, it appears as nowhitespace: afterproperty;, and often is repeated multiple times in a single rule. After trawling the web, I’ve found this mysterious property cropping up in stylesheets left and right, but never with a single bit of explanation as to what it does, or what the author thinks it does.
So, I’m appealing to you, Stackoverflow community, to please explain the origin of this property that, as far as I can tell, does absolutely nothing and is recognized by no known browser.
Here’s a snippet from the document I have, after prettifying:
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;
}
After searching for the text of the comments, I believe the origin of this CSS template to be a generic DreamWeaver template. Here. I wonder where my particular version came from.
nowhitespaceisn’t a valid CSS property in any of the main browsers. If you try it you’ll get an error or warning in that browser’s console window.Firefox gives me this error when I try it in jsfiddle:
When I google it I find a few stylesheets using the name, but as a class name, not as a property. It’s possible someone copied it without knowing what it was (i.e. cargo-cult programming).