【问题标题】:Why is my list-style-image not showing up?为什么我的列表样式图像不显示?
【发布时间】:2012-02-26 06:15:21
【问题描述】:

我正在构建this landing page,在第二段之后我有一个点列表,我已将列表样式图像应用于 li.actionItem,但是我得到的是默认光盘而不是我的图片。我知道该 url 有效,因为 a)我以绝对形式编写它,b)如果您输入该绝对 url,您将获得图像(请参见此处)和 c)我尝试将图标应用为带有一些填充的背景图像文本,并且有效。

如果必须,我最终可以这样做(带有填充版本的背景图像),但我更愿意将其写为列表样式图像。另外,这让我发疯了,为什么它不会那样显示,我想知道。

任何想法或提示?谢谢!

以下是相关标记一目了然...

            <ul id="introPoints">
                <li class="actionItem">performed more than <strong>500</strong> surgeries</li>
                <li class="actionItem">set more than <strong>3,000</strong> fractured bones</li>
                <li class="actionItem">mobilized more than <strong>90</strong> volunteers to Haiti</li>
                <li class="actionItem">sent pastors from our DR hospital to minister to the victims</li>
            </ul>

ul#introPoints {
list-style-image:url (http://blog.helpcurenow.org/images/campaigns/jan2010/haiticrisis/arrow-green-distress.gif);
list-style-type:disc;
}

li.actionItem {
    font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
    color:#6e5e4c;
    font-size:14px;
    text-align:justify;
    width:580px;
    font-style:italic;
    margin:10px 0px 10px 20px;
    text-indent:15px;
}
li.actionItem strong {
    color:#dd7439;      
}

【问题讨论】:

    标签: html css html-lists


    【解决方案1】:

    尝试使用背景图片。 list-style-image 无论如何都不会正确排列。

    background-image:url(...);
    background-repeat:no-repeat;
    background-position:0px 0px
    

    【讨论】:

      【解决方案2】:

      这可能是也可能不是问题,但根据css grammarurl 和左括号之间不能有空格..

      这样做:

      url(/someurl)
      

      不是这个:

      url (/someurl)
      

      【讨论】:

        猜你喜欢
        • 2015-05-04
        • 2014-08-26
        • 2020-07-15
        • 2019-12-10
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2018-08-28
        相关资源
        最近更新 更多