gpt4 book ai didi

html - CSS 在 HTML 中不使用 img 标签来显示图像

转载 作者:太空宇宙 更新时间:2023-11-04 02:12:44 25 4
gpt4 key购买 nike

我是 CSS 新手。我只想在章节标题前放一张图片。我有一个箭头图像,我想将该图像放在章节名称之前,只使用 CSS,而不使用 HTML <img>标签。

我的代码:

.body > .ce_label:before{
background: url("arrow.png");
}
<div id="body-proof" class="body top-most bottom-most">
<div id="OPT_ID_4224-proof" class="ce_label">
Chapter<span class="tb"></span>11<span class="te"></span>
</div>
</div>

我没有得到正确的设计输出。谁能帮我解决这个问题?

最佳答案

你可以为此使用下面的 css

.ce_label:before{
content: url(arrow.png);
}

关于html - CSS 在 HTML 中不使用 img 标签来显示图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39462416/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com