English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Complete CSS Selector Reference Manual
Content inserted after each <p> element:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Basic Tutorial(oldtoolbag.com)</title> <style> p:after { content:"- mark me"; } </style> </head> <body> <p>My name is Lili</p> <p>I live by the </p> <p><b>Notice:</b> :after in IE8It must be declared !DOCTYPE </p> </body> </html>Test to see ‹/›
:after Selector to insert content after the selected element.
Usecontent attribute to specify the content to be inserted.
The numbers in the table indicate the first browser version that supports the attribute.
Selector | |||||
---|---|---|---|---|---|
::after | 4.0 | 9.0 Parts from 8.0 | 3.5 | 3.1 | 7.0 Parts from4.0 |
Notice: after in IE8It must be declared<!DOCTYPE> .
CSS Tutorial: CSS Pseudo-elements
CSS Selector Reference Manual: CSS :before Selector
The content and style inserted after each <p> are:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Basic Tutorial(oldtoolbag.com)</title> <style> p:after { content:"- mark"; background-color:yellow; color:red; font-weight:bold; } </style> </head> <body> <p>My name is Lili</p> <p>I live by the </p> <p><b>Notice:</b> :after in IE8It must be declared !DOCTYPE </p> </body> </html>Test to see ‹/›