上週我完成了音樂商業網站的編碼: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