我正在尝试创建带有徽标和导航的标题。标志是背景。它在除 Internet Explorer 之外的所有浏览器中都能正确显示。这是标题的 HTML:

    <div id="header"><div id="navigation"><ul>
<li>
<a href="#" >Home</a>
</li><li>
<a href="#">Profile</a>
</li><li>
<a href="#">Topics</a>
</li><li>
<a href="#">Chat</a>
</li>
</ul>
</div>
</div>

这是CSS:
    #header{
position:fixed;
left:0;
right:0;
top:0;
z-index:1000;
width:100%;
height:48px;
}

/* Navigation */
#navigation{
    padding-left:50px;
background:url("http://localhost/img/logo/purple.png")no-repeat;
    position:absolute;
    left:0;
    top:0;
    min-height:48px;
     z-index:1010;
     display:inline-block;
}

有人可以告诉我为什么背景图片没有显示在 IE 中吗?它显示在所有其他浏览器中!

最佳答案

尝试使用

background-image:url('http://localhost/img/logo/purple.png');

关于html - 背景不显示在 Internet Explorer 中,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/23155771/

10-12 00:13
查看更多