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 odpowiedzi
+ 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