CSS Tutorial

CSS Style

CSS Layout Style

CSS Float Style

CSS Reference

CSS ::after Selector


What is ::after Selector?

CSS ::after element selector add the content to the end of parent element.
Added new content will inherited of parent properties.

Browser Compatibility

  • Google Chrome 2+
  • Mozilla Firefox 3.5+
  • Internet Explorer 9+
  • Opera 9.5+
  • Safari 1.3+

Note: Here details of browser compatibility with version number may be this is bug and not supported. But recommended to always use latest Web browser.

Syntax

General syntax of ::after selector,

/* CSS2 syntax */
element:after {
	property: value;
	property: value;
	...
}

/* CSS3 syntax */
element::after {
	property: value;
	property: value;
	...
}

Example:

CSS :after selector add the content to the end of parent element.

<style type="text/css">
    p.image::after{
        content: " - After Word";
        color: #FF0000;
    }
</style>
</head>
<body>

    <p class="image">Example is ::after Pseudo Elements </p>

</body>

Run it...   »

Example Result: