1

Updating an old stylesheet for a project at work, I found this CSS rule:

.element {
    height:0\0/
}

It's the first time I see anything like that, and my first instinct was to delete it (considering it was a mistake done by a developer with fat fingers). But as it was an old file, I didn't know if it had any meaning that I ignored so, I ran some tests: Chrome, Firefox and Opera consider that rule invalid and they ignore it... but Internet Explorer interprets it as height:0px.

That makes me think that it could be some type of hack for older versions of Internet Explorer, that drove me to do some research online, but I couldn't find anything (not that I got any relevant results searching by "0\0/").

Does anybody know if it means anything, and what it is (was) used for?

Alvaro Montoro
  • 28,081
  • 7
  • 57
  • 86
  • 3
    Related: http://stackoverflow.com/questions/8004765/css-9-in-width-property – Hunter Turner Aug 17 '16 at 16:37
  • 1
    And http://stackoverflow.com/questions/37021239/backslash-in-css-padding-shorthand-declaration – j08691 Aug 17 '16 at 16:38
  • @HunterTurner Thanks! That seems to explain it. Just out of curiosity, do you know if `\9` and `\0` could be used indistinctively? – Alvaro Montoro Aug 17 '16 at 16:43
  • 1
    If you have to use one of these, I would recommend the `\9` since it covers ie6-ie9. `\0/` is specific to ie8/ie9 and is required to be at the end of all of the rules for the element. Here is an old blog post with a bit of explaination: http://www.paulirish.com/2009/browser-specific-css-hacks/ – Derek Story Aug 17 '16 at 16:52
  • 1
    I don't think that this is a duplicate. `0\0/` is clearly different that `\9` and should be addressed. I think that @DerekStory should post an answer. Those other posts to not include this specifically. – sheriffderek Aug 17 '16 at 18:44

0 Answers0