+ 1
What is the use of ::before ::after?
When to use them kindly explain with examples for better explanation.
2 Réponses
+ 1
They're pseudo-selectors. With them, you can specify which elements to target in a DOM tree.
For example: .fancy-div p::before allows you to target all elements in a fancy-div class that come before p elements. This could be used to apply a bottom margin, fancy bottom border, a background image inside the element, etc.
0
🤔🤔🤔🤔