4 ms·
> I wish the double colon syntax didn't exist and we'd just use single colons, but as you say, it is what it is Single-colon is a pseudo-class, for targeting e
by Izkata 10mo ago
> I wish the double colon syntax didn't exist and we'd just use single colons, but as you say, it is what it is
Single-colon is a pseudo-class, for targeting elements based on some external state. I learned these as "pseudo-selectors" but it seems that's not the right name.
Double-colon is a pseudo-element, for targeting inner parts of an element that themselves aren't actually an element in the document.
- jraph 10mo agoRight! Thanks for this. I've never really looked into this and have been writing whatever worked, with a preference for the single colon. CSS 1 & 2 apparently conflated the two, and CSS 3 allows one column for CSS 1 & 2 pseudo elements. I never noticed it wasn't all of them. Since I learned CSS right before CSS3, my situation kinda makes sense I guess. Single colons everywhere have felt easier and more regular to me, so I've written basically everything with single colons except maybe the odd CSS 3 pseudo element here and there. But it seems the two colons will be mandated going forward. I guess I'll have some edits to do, though I do hope and kinda expect they won't break backward compatibility. https://stackoverflow.com/questions/17684797/should-i-use-single-colons-or-double-colons-for-before-after-first-le#28527928 https://stackoverflow.com/questions/17684797/should-i-use-si...