0
What is the diffrence between pseudo elements and pseudo classes in CSS?
&in pseudo elements even if you remove one double colon it still works nicely..... example: (element::before)(element:before)
2 Answers
+ 4
âśWhat are Pseudo-classes?
â´ A pseudo-class is used to define a special state of an element.
For example, it can be used to:
â´ Style an element when a user mouses over it
â´ Style visited and unvisited links differently
â´ Style an element when it gets focus
https://www.w3schools.com/css/css_pseudo_classes.asp
âśWhat are Pseudo-Elements?
â´ A CSS pseudo-element is used to style specified parts of an element.
For example, it can be used to:
â´ Style the first letter, or line, of an element
â´ Insert content before, or after, the content of an element
https://www.w3schools.com/css/css_pseudo_elements.asp
đŠ IMPORTANT
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.
0
Thank You