css - 列表样式图像不工作 : no markers present

标签 css list html-lists markers

这是我的 CSS:

#navcontainerF ul
{
margin: 0;
padding: 0;
list-style-type: none;
list-style-image: url('img/sqpurple.gif');
text-align: center;
border-style:solid;
border-top:thin dashed #D2BDBE;
border-left:thin dashed #D2BDBE;
border-right:thin dashed #D2BDBE;
border-bottom:thin dashed #D2BDBE;
}

#navcontainerF ul li { display: inline; }

#navcontainerF ul li a
{   
    text-decoration: underline;
    padding: .2em 1em;
}

这是我的 HTML:

<div id="navcontainerF">
    <ul>
        <li><a href="page1.php">Page 1</a></li>
        <li><a href="page2.php">Page 2</a></li>
        <li><a href="page3.php">Page 3</a></li>
        <li><a href="page4.php">Page 4</a></li>
    </ul>
</div>

我希望看到带有标记 的元素符号列表,但没有出现这样的标记。 我肯定有“list-style-image”的正确图像 url。 可能是什么问题?

非常感谢, 哈利

最佳答案

确保图片路径是相对于 CSS 文件的,而不是 HTML 文件。因此,如果您将样式表放在一个名为 CSS 的文件夹中,那么您必须将:

list-style-image: url('../img/sqpurple.gif');

关于css - 列表样式图像不工作 : no markers present,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22313782/

相关文章:

r - 如何绑定(bind)两个具有相同结构的列表?

html - 使用 CSS 和单个列表的简单 2 列导航?

html - <li> 换行填充错误 - 尝试在正确维护左边框的同时解决

html - 将 ol 列表编号排列到左侧

jquery - 增加完整日历的最大宽度 css 会忽略 scrollTime

css - iframe 的 HTML5 样式

html - 如何使 "image banner"100% 的视口(viewport)没有边距,以及页面中心的其余部分

html - 如何在左 :-20px;? 之后加宽 .li 右边缘

javascript - 选择选项以触发表格外观

python - 打印出文本文件中的句子数