我有一个非常简单的网站,其中包含一个简单的水平菜单,它似乎可以在所有浏览器(IE8以外的浏览器)下工作(并且可能会更老,但我无法访问测试)。背景图像在IE8中无法正确显示
我在问题中引用了“背景图像”,因为我经历了一个小的消除过程,发现当我从代码中省略背景图像时,该菜单起作用(尽管没有背景图像)。
CSS代码这里:
.cssmenu ul {
display: block;
overflow: auto;
margin: 0px;
padding: 0px;
list-style-type: none;
font-size: 16px;
font-weight: normal;
}
.cssmenu a {
display: block;
/*width: 6em;*/
color: black;
text-decoration: none;
white-space: nowrap;
}
.cssmenu a:hover {
display: block;
/*width: 5em;*/
color: #46a446;
text-decoration: none;
white-space: nowrap;
}
.cssmenu li {
float: left;
margin-right: 1.5em;
background-image: url('Images/Dark_Green_Beveled_Circle.jpg');
background-position:left center;
background-size: 16px 16px;
background-repeat: no-repeat;
padding-left: 20px;
padding-right: 5px;
white-space: nowrap;
}
.cssmenu li:hover {
background-image: url('Images/Light_Green_Beveled_Circle.jpg');
background-position:left center;
background-size: 18px 18px;
background-repeat: no-repeat;
white-space: nowrap;
}
.cssmenu ul li.current {
background-image: url('Images/Light_Green_Beveled_Circle.jpg');
background-position:left center;
background-size: 20px 20px;
background-repeat: no-repeat;
white-space: nowrap;
}
HTML代码在这里:
<td colspan="2" class="cssmenu">
<img src="Images/image1-8.png" alt="logo">
<ul>
<li class="current"><a href='#'><span>Home</span></a></li>
<li><a href='UberUns/UberUns.html'><span>Über uns</span></a></li>
<li><a href='Termine/Termine.html'><span>Termine</span></a></li>
<li><a href='Angebot/Angebot.html'><span>Angebot</span></a></li>
<li><a href='Verkaufen/Verkaufen.html'><span>Verkaufen</span></a></li>
<li><a href='WeitereInfos/WeitereInfos.html'><span>Weitere Infos</span></a></li>
<li><a href='Kontakt-Lageplan/Kontakt_Lageplan.html'><span>Kontakt</span></a></li>
<li><a href='Intern/Intern.html'><span>Intern</span></a></li>
</ul>
</td>
这里是网址:http://www.boerse-daellikon.ch/index.html
最不是'背景image'其他的'background'属性在IE8不支持。像'background-size'。你最好使用一个图像相同的图像,而不是稍后应用'background-size'。 –
您使用尺寸为93x93px的图像'Light_Green_Beveled_Circle.jpg'。 IE8将显示此图像的完整大小。您可以使用小尺寸图片作为背景图片 –
我想非常感谢这样的快速回复!我很高兴能够找到这个支持网站:-) – Scott