源代碼
點擊運行
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>教程</title> <style> h1:after {content:url(smiley.gif);} </style> </head> <body> <h1>This is a heading</h1> <p>The :after pseudo-element inserts content after an element.</p> <h1>This is a heading</h1> <p><b>注意:</b>僅當!DOCTYPE 已經聲明 IE8支持這個內容屬性.</p> </body> </html>
運行結果