哪个元素用于在 CSS 元素后插入一些内容

cssweb developmentfront end technology更新于 2025/3/16 22:36:17

使用 :after 元素在元素后添加一些内容。

示例

您可以尝试运行以下代码,使用 CSS 在元素后插入一些内容 −

<html>
   <head>
      <style>
         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>

相关文章


有用资源