CSS3元素 before after 用法

<style>
p:before
{
content:"www.96net.com.cn:";
}

p:after
{
content:"www.96net.com.cn:";
}
</style>

<p>我是唐老鸭。</p>
<p>我住在 Duckburg。</p>

<p><b>注释:</b>对于在 IE8 中工作的 :before,必须声明 DOCTYPE。</p>

before  after在每个 <p> 元素的内容之前后插入新内容:

 

posted @ 2022-02-06 14:14  学无边涯  阅读(45)  评论(0编辑  收藏  举报