This question is similar to the one I asked here. I am cleaning up some files and I came across this in this css:
.something
{
height: 33px;
-height: 34px; /* does this do anything?? /
}
and
.something
{
_width: 150px; / does this do anything?? */
}
EDIT: Okay, so the _ (underscore) is a css hack for IE, which is fine, I'll just leave it, but what about the minus sign, does it do anything at all?
Also, we are not supporting anything below IE 7 anymore, so if anything is a hack for IE6 I can take it out.
Straight from the W3C CSS 2.1 Spec -
4.1.2.1 Vendor-specific extensions
In CSS, identifiers may begin with '
-
' (dash) or '_
' (underscore). Keywords and property names beginning with '-
' or '_
' are reserved for vendor-specific extensions.
However that said, using an underscore to prefix a CSS property is a well known CSS hack to apply that rule for rendering in IE 6.
Since a CSS identifier can start with a '-
' (dash) and be valid, this can be used to quickly comment out parts of CSS during development. For example in the CSS below, none of the properties will be set for h1
and only margin
will be set for h2
.
-h1 { color:blue; margin:2em; }
h2 { -color:pink; margin:2em; } /* property "-color" not valid */
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With