當(dāng)前位置:首頁 > IT技術(shù) > Web編程 > 正文

一個相當(dāng)不常見的css樣式,css的Content屬性
2022-09-06 22:44:36


用于在每個鏈接(即a標(biāo)簽)后插入內(nèi)容,最終顯示為如下樣式

?

this is a (inserted text)
示例:
html代碼:
<pre name="code" class="html"><a>aaaaa</a>

?

?

?

?

?


?


css代碼:

?

?

a:after
{content: " 啊啊啊啊"
}

最終效果為:

?

一個相當(dāng)不常見的css樣式,css的Content屬性_html

而且其中的漢字部分是不能被選中的。

而且css中也可以這樣寫:

?

a:after
{content: " (" attr(href) ")"
}

即顯示此標(biāo)簽的href字符串。

?

其他好像沒有什么特別作用。
?

?

本文摘自 :https://blog.51cto.com/u

開通會員,享受整站包年服務(wù)立即開通 >