+ 1
What is the difference between the pseudo elements?
I've learnt how to use pseudo elements and i used them a lot in in my designs but I still don't know what is the difference between the pseudo (:before) and the other one (::before) , the same thing for the pseudo (:after) and (::after) , I tried to know the difference between the pseudo elements as they do the same functionalities. is there any deep difference between them even in an example related to an other programming language ?
6 Réponses
+ 2
thank you for your help 😁😎!!
+ 4
Hassan Sahlaoui A way to thanks (and above all to help future users to find best answer to same question) is mark as best answer the REAL best answer... Just for info
+ 3
There's not a deep difference. If I recall correctly...
When CSS 2 was launched, both pseudo classes and pseudo elements had a single colon.
When CSS 3 launched, pseudo elements were designated with double colons to distinguish them from pseudo classes, which retain the single colon.
So basically it comes down to backwards compatability (cough - Internet Explorer - cough). I'll try to dig up a reference for you.
Update - Here's the reference:
https://www.w3schools.com/css/css_pseudo_elements.asp
Further reading:
https://css-tricks.com/to-double-colon-or-not-do-double-colon/
+ 3
You're welcome. 😁
+ 2
Hassan Sahlaoui Its right but it dont match with reality
0
Yeah that's right