What Is Pseudo Elements In Css? Pseudo Elements Css
Being a developer you must have come across the term Pseudo Elements, these are a handful of majorly used tools of CSS. It is usually defined as a keyword combined with a selector which delineates the special state of the selected elements.
Let’s take a further look at how these pseudo-elements are used.
Commonly used Pseudo Elements
- ::after
- ::before
- ::first-line
- ::first-letter
- ::selection
Note: Do not confuse pseudo classes with the pseudo elements. Main difference between Pseudo classes(like ‘:hover’) and Pseudo elements (like ‘::before’) is no. of colons.
1. ::after pseudo-element –
Example:-
2. ::before pseudo element –
Example:-
3. ::first-line pseudo element –
Example:-
4. ::first-letter pseudo element –
Example:-
5. ::selection pseudo element:
- Color
- Backgroung-color
- Text-decoration
- Text-shadow
- Stroke-color
- Stroke-width
- Fill-color
Example:-
Leave a comment below and let us know if you have any queries.
Restaurant Website Using HTML And CSS With Source Code
Everyone’s journey starts as Beginner so if you have any type of confusion drop a comment we are here to reply & provide the best information regarding your comment. Thank you for reading!
Thank you for visiting our Blog today. Please Check out our other posts.
Written by: @OmBandiwan