代码之家  ›  专栏  ›  技术社区  ›  Luca Reghellin

什么样的内容可以传递给css的“content”属性?

css
  •  0
  • Luca Reghellin  · 技术社区  · 8 年前

    我是说,除了简单的文字广告,最终 attr() 功能,我们可以“合法”传递给 content css属性?例如,我可以传递html代码吗?

    1 回复  |  直到 8 年前
        1
  •  1
  •   Torjescu Sergiu    8 年前

    这个 content 属性与 ::before 和 ::after 伪元素,以插入生成的内容。

    CSS语法:

    content: normal|none|counter|attr|string|open-quote|close-quote|no-open-quote|no-close-quote|url|initial|inherit;