Possible Duplicate:
Which type of quotes we should use in css background url (“…”)? Single, double or no quote needed?
Simple question. What quotation marks should I use in CSS?
Option #1:
background: url( 'foo.png' );
Option #2:
background: url( "foo.png" );
Both works on "normal browsers". I just want to follow the standards.
Double quotes on the first quote, single quotes on the second. A quote with French quotes. You can place as many pairs of quotes in the quotes property as you like. But you don't have to put more than two, because for every extra quote it simply repeats the quotes values from the beginning.
Both single (' ') and double (" ") quotes are used to represent a string in Javascript. Choosing a quoting style is up to you and there is no special semantics for one style over the other. Nevertheless, it is important to note that there is no type for a single character in javascript, everything is always a string!
They are interchangeable. The only important note is not to use one inside itself.
The main difference between double quotes and single quotes is that by using double quotes, you can include variables directly within the string. It interprets the Escape sequences.
The standards say:
The format of a URI value is 'url(' followed by optional white space followed by an optional single quote (') or double quote (") character followed by the URI itself, followed by an optional single quote (') or double quote (") character followed by optional white space followed by ')'. The two quote characters must be the same.
i.e. none, single or double. If you care about IE5/Mac (which you probably don't these days) avoid '
, otherwise use whatever makes you comfortable.
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