HTML CSS examples for CSS Selector:after
The ::after selector selects content after the content of each selected element.
You can use the content property to set the content to insert.
You can Use the ::before selector to add something before the content.
The following code shows how to insert content after every <p> element, and style the inserted content.
<!DOCTYPE html> <html> <head> <style> p::after {<!-- w w w. j a va2s. co m--> content: " - added content"; background-color: yellow; color: red; font-weight: bold; } </style> </head> <body> <p>this is a test</p> <p>this is another test</p> </body> </html>