【问题标题】:what does content : '' mean in pseudo class?content : '' 在伪类中是什么意思?
【发布时间】:2018-04-02 11:40:17
【问题描述】:

css 伪类中的“{content : ' '}”是什么意思?

我每天都在想,这是什么意思?

谁能帮帮我

【问题讨论】:

标签: css html pseudo-class


【解决方案1】:

在 css 中,你使用 content 来设置内容(或内部 html)

这是mozilla doc的一个明显例子

HTML

<a href="http://www.mozilla.org/en-US/">Mozilla Home Page</a>

CSS

a::before {
  content: url("https://mozorg.cdn.mozilla.net/media/img/favicon.ico") " MOZILLA: ";
  font: x-small Arial, sans-serif;
  color: gray;
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-05-03
    • 2020-07-09
    • 1970-01-01
    • 2017-05-07
    • 2011-08-12
    • 2017-06-11
    相关资源
    最近更新 更多