我正在尝试创建带有 Logo 和导航的页眉。标志是背景。它在除 Internet Explorer 之外的所有浏览器中都能正确显示。这是 header 的 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/