【问题标题】:ordered list with background image not displaying correctly in IE10, IE11带有背景图像的有序列表在 IE10、IE11 中无法正确显示
【发布时间】:2017-07-29 09:42:26
【问题描述】:

我的网页上有以下 HTML 代码来创建列表

<ul class="rightdivul">
               <li id="linkedinli">
                   <a href="https://www.linkedin.com/in/xxxxxx">www.linkedin.com/in/xxxxxx</a>
               </li>



               <li id="twitterli">
                   <a href="https://twitter.com/xxxxx">@xxxxxx</a>
               </li>

           </ul>

我正在使用以下 CSS 来设置样式:

ul.rightdivul {
text-align: left;
list-style-type: none;
font-weight: 300;
padding-left: 20px;
font-weight: 300;
color: #23313E;

}

#linkedinli {
background: url(images/Linkedin.svg) no-repeat;
padding-left: 30px;
margin-bottom: 15px;


}

#twitterli {
background: url(images/Twitter.svg) no-repeat;
padding-left: 30px;
margin-bottom: 3px;

}

在 Chrome、Firefox、Opera、Safari、Edge 中,背景图像在文本之前正确显示。但是在 IE10、IE11 中,背景图像与文本重叠。我在这里遗漏了什么吗?

【问题讨论】:

    标签: html css


    【解决方案1】:

    试着写这个:

    background: url(/*your url*/);
    background-repeat: no-repeat;
    

    而不是这个:

    background: url(/*your url*/) no-repeat;
    

    【讨论】:

    • 感谢 Larpee 的回复,不幸的是,调整这个并没有解决问题。
    • @Dresse 哦,很抱歉没有
    • 显然问题出在我的 svg 图片中,我最终在以下主题中找到了答案:stackoverflow.com/questions/17944354/…
    • @Dresse 很高兴你找到了答案,谢谢分享,我对你的问题很感兴趣
    猜你喜欢
    • 1970-01-01
    • 2012-01-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-11-09
    • 2020-08-13
    • 2015-05-03
    • 2016-09-09
    相关资源
    最近更新 更多