What is the difference between the pseudo elements? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 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 ?

1st Nov 2018, 4:51 PM
Hassan Sahlaoui
Hassan Sahlaoui - avatar
6 Answers
+ 2
thank you for your help šŸ˜šŸ˜Ž!!
2nd Nov 2018, 9:27 AM
Hassan Sahlaoui
Hassan Sahlaoui - avatar
+ 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
2nd Nov 2018, 1:08 PM
KrOW
KrOW - avatar
+ 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/
1st Nov 2018, 11:48 PM
Janningā­
Janningā­ - avatar
+ 3
You're welcome. šŸ˜
2nd Nov 2018, 10:06 AM
Janningā­
Janningā­ - avatar
+ 2
Hassan Sahlaoui Its right but it dont match with reality
2nd Nov 2018, 1:42 PM
KrOW
KrOW - avatar
0
Yeah that's right
2nd Nov 2018, 1:38 PM
Hassan Sahlaoui
Hassan Sahlaoui - avatar