CSS :after 選擇器
定義和用法
:after 選擇器在被選元素的內(nèi)容后面插入內(nèi)容。
請使用 content 屬性來指定要插入的內(nèi)容。
親自試一試 - 實例
在每個 <p> 元素后面插入內(nèi)容,并設(shè)置所插入內(nèi)容的樣式:
p:after
{
content:"臺詞:-";
background-color:yellow;
color:red;
font-weight:bold;
}
:after 選擇器在被選元素的內(nèi)容后面插入內(nèi)容。
請使用 content 屬性來指定要插入的內(nèi)容。
在每個 <p> 元素后面插入內(nèi)容,并設(shè)置所插入內(nèi)容的樣式:
p:after
{
content:"臺詞:-";
background-color:yellow;
color:red;
font-weight:bold;
}