Skip to content
Related Articles

Related Articles

How content property is used with :after selector in CSS ?

View Discussion
Improve Article
Save Article
  • Last Updated : 18 Apr, 2021

In this article, we will learn how content property is used with the :after selector in CSS. The :after selector is used to inserting something after any selected element. And the content property is used to specify the content that will be inserted. So we use the content property in ::after selector to put something after the selected element.

Approach: The content property is used to insert content after or before any selected element. So we use content in :after selector to insert something after the selected element. 


    content : value;



<!DOCTYPE html>
            content: "GeeksforGeeks";
            color: green;
            font-size: 30px;
            border-bottom: solid 5px green;
    <p style="font-size:30px;">
        Best website to learn coding: 


My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!