CSS - 偽元素 :after



        描述

        :after 偽元素用於在元素之後插入一些內容。

        示例

        以下示例演示瞭如何使用:after 元素在任何元素之後新增一些內容。

        <html>
           <head>
              <style type = "text/css">
                 p:after {
                    content: url(/images/bullet.gif)
                 }
              </style>
           </head>
        
           <body>
              <p> This line will be succeeded by a bullet.</p>
              <p> This line will be succeeded by a bullet.</p>
              <p> This line will be succeeded by a bullet.</p>
           </body>
        </html> 
        

        這將生成以下黑色連結 -

        css_references.htm
        廣告

© . All rights reserved.