【问题标题】:CSS issues with div on Internet Explorer 9Internet Explorer 9 上 div 的 CSS 问题
【发布时间】:2011-11-29 22:42:48
【问题描述】:

我将透明 div 放置在图像上以链接图像的一部分。这在 firefox、opera、chrome en safari 中完美运行。但是当我在 IE 上尝试这个时,它给出了问题。我自然认为这是 css 位置的问题,但是当我给 div 一个背景色时,它突然起作用了。

是否可以使用具有透明背景的 div 来链接某些东西?

HTML:

<div id="linksabout" class="links" ></div>
<div id="linksnames" class="links" ></div>
<div id="linksabc" class="links" ></div>
<div id="linkscontact" class="links" ></div>
<div id="linksnews" class="links" ></div>

与 jquery 的链接:

$('#home').click(function()
{
    change_page(1);
});
$('#about').click(function()
{
    change_page(2);
});

等等……

宽度和高度由 css 定义。 谢谢

【问题讨论】:

    标签: css internet-explorer


    【解决方案1】:

    我之前在 IE 中遇到过这个问题,一种解决方案是使用图像映射,或者您可以添加背景颜色并将不透明度设置为 0

    #home{ background-color:#000; opacity:0; filter:alpha(opacity=0); /* For IE8 and earlier */}

    【讨论】:

      猜你喜欢
      • 2017-09-24
      • 2012-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-01
      • 2012-08-27
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多