0

Both are working but what is the best practice?

W3Schools says :

Notice the double colon notation - ::first-line versus :first-line

The double colon replaced the single-colon notation for pseudo-elements in CSS3. This was an attempt from W3C to distinguish between pseudo-classes and pseudo-elements.

The single-colon syntax was used for both pseudo-classes and pseudo-elements in CSS2 and CSS1.

For backward compatibility, the single-colon syntax is acceptable for CSS2 and CSS1 pseudo-elements.

I went for "::" but I don't have backward compatibility then...

James Donnelly
  • 126,410
  • 34
  • 208
  • 218
  • 1
    There is no real answer except that using a single colon `:` is backwards compatible with browsers such as IE8. In theory the single colon syntax support could be dropped in future browsers, but that is unlikely and a matter of opinion. There doesn't seem to be a reason not to use it if you need to support older browsers. – misterManSam Sep 03 '15 at 15:18
  • Already discussed in [this question here](http://stackoverflow.com/q/10181729/2930477) with a bunch of opinions. – misterManSam Sep 03 '15 at 15:32
  • 1
    That quote is from W3Schools, **not** W3C. I've edited the question. W3C is the World Wide Web Consortium which holds the various HTML and CSS specifications. W3Schools is an unrelated (and often lowly-regarded) website which attempts to convert the various specifications into simple English. – James Donnelly Sep 09 '15 at 14:52

0 Answers0