I inherited a CSS stylesheet and in a few places it does things like:
margin:7px 0 0 0;
/margin-top:9px;
or
background: url(../images/list-hover.png) 0 0 no-repeat;
/background:url(../images/lists-hover.png) 0 2px no-repeat;
anyone know what that forward slash is doing?
The forward slash is required syntax for separating background position values and background size values. This is to eliminate misinterpretation of the values specified. If you're going to specify both, then background-position has to come first, then the forward slash, then the background-size.
In most cases, the tag is repeated at the end of the content, with the tag name preceded by a forward slash (e.g. </p>), to indicate that the action is no longer needed.
Also, you may know their differences. The easy way to remember them is that a backslash is a backward lean (\) while a forward slash leans forward (/).
A trailing slash is a forward slash (“/”) placed at the end of a URL such as domain.com/ or domain.com/page/. The trailing slash is generally used to distinguish a directory which has the trailing slash from a file that does not have the trailing slash.
It's to target LTE IE7. This hack isn't known as much as the IE6 underscore one.
#myelement {
background:red; /*Should show as red in all browsers, expect IE6 and IE7 because...*/
/background:yellow; /*IE7 should have yellow*/
_background:green; /*IE6 should have green*/
}
You can make the backslash almost anything you want really, expect the underscore _ as that will target IE6. I use the $ personally.
EDIT:
I've included the IE6 trick too there, as anything IE7 and below will take the / property unless you also have an _ property too.
To target IE8, IE7, and IE6 you need to have that order above.
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