上周,我完成了为一家音乐公司编写此网站的代码:http: //academy.young1.org。
它在 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;
等等
最简单的比较方法可能是在两个浏览器中查看该站点,然后单击“查看源代码”...
如果有人可以提供帮助,我将不胜感激!
问候,
罗伯特