上周我完成了音乐商业网站的编码:http://academy.young1.org。为什么我的背景图像在ie8中不显示?
它在ie10和chrome中像一个魅力一样工作,我正忙着向大家展示它,但当我切换到ie8时,突然意识到我的所有背景图像都消失了。
还有其他一些小问题(比如顶部菜单的文本对齐,'联系'页面和WMU Slider Jquery插件上的分页),但是背景图片问题最让我烦恼!我使用的是CSS:'body {background:url(“img/yourimagehere”); }' 句法。
这里是我的html:
<div class="header">
<div class="container_16 clearfix">
<ul class="nav grid_16 alpha">
<li><a class="<?php if ($section == "Home") {echo "here"; } ?>" href="index.php" accesskey="1"> Home </a></li>
<li><a class="<?php if ($section == "About Us") {echo "here"; } ?>" href="about_us.php" accesskey="2"> About </a></li>
<li><a class="<?php if ($section == "What We Do") {echo "here"; } ?>" href="what_we_do.php" accesskey="3"> What We Do </a></li>
<li><a class="<?php if ($section == "Enrolement") {echo "here" ; } ?>" href="enrolement.php" accesskey="4"> Enrolement </a></li>
<li><a class="<?php if ($section == "Contact Us") {echo "here" ; } ?>" href="contact.php" accesskey="5"> Contact Us </a></li>
<!--<li><a href="http://youngacademyblog.blogspot.co.uk/" accesskey="6"> Blog </a></li>-->
</ul>
<div id="logo">
<a href="index.php"><img src="img/Logo original.gif" alt="The Young Academy"/></a>
</div>
<div class = "grid_4 alpha">
<div class="telephone grid_4 alpha">
<img src="img/phone_icon_white.png" alt="small telephone logo" class="align-left small" />
<p> +44 (0)20 8866 3813 </P>
</div>
<div class="timezone">
<p><?php
date_default_timezone_set('Europe/London');
mktime(0,0,0,1,1,1970);
echo date('l, d F Y');
?> </p>
<!--<form action="http://www.example.com/login.php">
<p>
<input type="text name=search" size="20+" id="search" value="Search this site"
</p>
</form>!-->
</div>
</div>
<ul class="secondmenu grid_6 push_3">
<li><a class="<?php if ($section == "Musical Glossary") {echo "here" ; } ?>" href="glossary.php">Musical Glossary </a></li>
<li><a class="<?php if ($section == "FAQ") {echo "here" ; } ?>" href="faq.php">FAQ</a></li>
<ul>
</div>
<div class="container_16 clearfix">
<div class="wmuSlider">
<div class="wmuSliderWrapper"/>
等 和我的CSS:
/*html5 fix*/
article, aside, figure, footer, header, hgroup, menu, nav, section {
display: block;
}
body {
background: url("../img/soft_wallpaper.png");
}
/****************
header
*****************/
.header {
background: #212962 url("../img/header_backgrounddark.png");
height: 160px;
width: 100%;
/*z-index: 11; */
}
#logo {
float: right;
position: relative;
top: -45px;
等
比较可能在两到查看该网站的最简单方法浏览器并点击'查看源代码'...
我会感激它,如果任何电子可以帮助!
问候,
罗伯特
没有定义DOCTYPE。可能不是这里的问题,但... – melancia
只是你知道,它也不适用于IE9。我可以看到样式的重复? index.css和style.css? – melancia