CSS图像在刷新后消失 [英] CSS Images disappear on refresh
本文介绍了CSS图像在刷新后消失的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在将图像应用于CSS中的 li
元素,该图像在我首次加载时显示在 li
项旁边,但是在刷新后它们消失了,替换为项目符号点.我正在使用使用Safari的预览选项coda 2,但在Firefox(最新版本)和Chrome(最新)中,图像甚至都不会加载.
I'm applying an image to a li
element in CSS, the image appears next to the li
items when I first load but then after a refresh they vanish and are replaced by bullet point. I'm using the preview option coda 2 which uses Safari but in Firefox (latest version) and Chrome (latest) the images don't even load.
我的CSS代码非常简单,我不知道为什么会发生此问题
My CSS code is really simple and I have no idea why this issue is taking place
ul {
list-style-image:url("images/star.png");
}
li {
margin: 10px 0px 0px 0px;
}
推荐答案
您的CSS应该可以正常工作.测试:
Your CSS should be working. Test:
ul {
list-style-image: url(http://stater.mahdaen.name/icons/favicon-16x16.png);
}
li {
margin: 10px 0 0 0;
}
<ul class="org">
<li>Test</li>
<li>Test</li>
<li>Test</li>
</ul>
如果您的CSS无法正常工作,则可以进行以下检查:
If your CSS is not working, then you may check this:
- 请勿将自定义显示应用于
li
(例如inline-block
). - 图像存在.
- 列表样式仍然没有被其他CSS覆盖.
这篇关于CSS图像在刷新后消失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文