CSS Images disappear on refresh

∥☆過路亽.° 提交于 2019-12-24 05:25:06

问题


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.

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;
}

回答1:


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>

If your CSS is not working, then you may check this:

  1. Do not apply custom display to the li (e.g inline-block).
  2. Image is exist.
  3. List style is still not overridden by other css.


来源:https://stackoverflow.com/questions/32596026/css-images-disappear-on-refresh

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!