【问题标题】:Use HTML character as a background使用 HTML 字符作为背景
【发布时间】:2020-06-24 18:24:24
【问题描述】:

我已关注this answer 以获取this html character 作为背景图片。它运行良好,但不能作为背景,HTML 字符位于文本之上。我已经尝试了几种可能性,但我认为有些东西超出了我的知识范围。

.number {position: relative;
    font-family: sans-serif;
    font-size: 18px;
    font-weight: bold;
    color: red;
}
.number::after {
    content: "\2617"; 
    color: blue; 
    margin-left: -1em; 
    font-size:30px;
}
<div class="number">
90
</div>

【问题讨论】:

    标签: html css background


    【解决方案1】:

    使用z-index 属性:

    .background {
      position: absolute;
      z-index: -9999;
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2012-05-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-25
      • 1970-01-01
      相关资源
      最近更新 更多