CSS/Selectors/pseudo-elements/:after

From Web Education Community Group
< CSS‎ | Selectors
Jump to: navigation, search

Pseudo-classes ::after

The ::after pseudo-element can be used to describe generated content after an element's content.

Syntax

selector::after{ preperties }


Point, Note

  • When the ::first-letter and ::first-line pseudo-elements are applied to an element having content generated using ::after, it applies to the first letter or line of the element including the generated content.


Example

[style.css]

 p:after{
   content: "  :Note";
 }

[index.html]

<body>
  <p>In CSS 2.1, it is not possible to refer to attribute values 
     for other elements than the subject of the selector.</p>
</body>

Css3 selectors after.png

CSS defines the ::after pseudo-element in 7.4. The ::before and ::after pseudo-elements.