背景图像没有出现在IE8中

时间:2013-05-03 01:54:58

标签: css image internet-explorer-8 background

我有一个背景图片,我正在尝试用作徽标。一切都很好Chrome和& FF,但它没有在IE8中显示。背景图片根本不加载。如何让它们在IE8中显示?

这是代码:

<header>
    <h1 class="logo">
        <a href="http://publix.newhaven.edu/hlee-test">Henry C. Lee Institute of Forensic Science</a>
    </h1>    
</header>

的CSS:

header {
    margin: 0 10px 38px 7px; 
    padding: 30px 0 0 0;
}
header h1{
    width:232px;
}
header h1 a {
    background:url('images/logo.png') 0 0 no-repeat; 
    display:block;
    height:89px;
    text-decoration:none; 
    text-indent:-9999px;
    width:243px;
}

3 个答案:

答案 0 :(得分:0)

你的

header h1 a {
   ....
}

需要line-height

答案 1 :(得分:0)

接下来添加您网页的head

<!--[if lt IE 9]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->

在css中,您需要为新的html5标签编写默认样式:

header, footer, section, nav, article {
    display: block;
    margin: 0;
    padding: 0;
}

html5shiv.js - 在DOM中创建新的html5标签。像IE8这样的旧浏览器不了解html5标签。

https://code.google.com/p/html5shiv/

答案 2 :(得分:0)

给出适当的浮动属性。它正在影响它。

相关问题