Before and after are the css pseudo elements which are used to add content just before and after the content of the element.

Before

It is used to add some content just before the content of the element.

For example-

When you execute this code, you will see a smiley just before the heading which is inserted by using before element.

before element css pseudo elements

After

It is used to add some content just after the content of the element.

For example-

When you execute this code, you will see a smiley just after the heading which is inserted by using after element.

after element css psuedo elements

 

You May Also Like

  • Two Colon(::) mean Pseudo Element and Single Colon(:) Mean Pseudo Class.
Subscribe To Our Newsletter For More Tips & Tricks on Elegant Themes

Subscribe To Our Newsletter For More Tips & Tricks on Elegant Themes

You have Successfully Subscribed!

Share This