Today I will discuss about Pseudo elements
:after and
:before.
Where is it used?
# It's used where we need to put something before the element or after the element.
# By the way, There is no limit means you can put before pseudo element else where or at the end of the element by manipulating some properties like position, top, left etc.
# The
:after and
:before pseudo elements are very useful when you develop something with one element.
# I've made a little demo in CodePen, So you can understand simply from that...:)
# You can see in the css tab that It's just simple using
:before and
:after pseudo and two properties
content and
color.
# It's called
pseudo elements not
pseudo selectors because pseudo selectors select which is already exist and pseudo element is not selecting, it's putting some content/symbol etc.
# I've made a little cool demo with the help of
:before and
:after and
blockquote.
# Any questions related to this ? I'd like to answer in comments.
# I'm giving you some links which is helpful to learn Pseudo-Elements.
Pseudo-Elements | MDN
Selectors | W3C