【问题标题】:IE6/7 link overlapping + text-indentIE6/7 链接重叠 + 文本缩进
【发布时间】:2010-11-15 20:31:19
【问题描述】:

我需要一点指导......

我有 2 个链接:

<div class="tarjBodyHolder">
    <div class="imageHolder">
        <a href="#" onclick="alert('picture link'); return false;">
           <img border="0" src="/picture.jpg" />
        </a>
    </div>
    <div class="linkTransp">
       <a href="#" onclick="alert('family link'); return false;">RAM Moudles</a>
    </div>
</div>

CSS:

.tarjBodyHolder{
    position: relative; 
    clear: both; 
    height: 152px;
 }

.tarjBodyHolder .linkTransp{
     position: absolute; 
     bottom: 0px; 
     left: 0px; 
     width: 120px;
     height: 15px;
     z-index: 6; /*IE bug*/
}
.tarjBodyHolder .linkTransp a {
     display: block;
     text-indent: -9999px; 
     width: 120px; 
     height: 15px;
     overflow: hidden;
     z-index: 6;
 }
 .tarjBodyHolder .imageHolder{
     position: absolute; 
     bottom: 0px; 
     left: 0px;/*IE 7 bug*/
 }

这是下一个:

img 链接是一个项目的图片。这张图片上印有物品所属的类别。例如:DDR RAM 模块上印有图片和字符串“

重叠“不可见”(*) 类别链接和图片链接。这就是我使用的原因 位置:绝对; 在 Firefox 上它真的很棒.. 但我无法弄清楚如何在 IE6 / 7 上执行此操作。无论我做什么它都不适用于 text-indent: -9999px .. 如果我评论这个文本变得可见并且我可以点击它..但不能。 我什至尝试过声明 A 的宽度和高度!!

(*) 我说“不可见”是因为这个链接应该有文字......但你不应该看到它,因为它缩进了 -9999px。

【问题讨论】:

    标签: css xhtml internet-explorer-6 internet-explorer-7 text-indent


    【解决方案1】:

    听起来像你想要的和老式的图像地图。像这样重叠链接的项目很少是一个好主意。

    我听到的是你有一个形象。图片的一部分(图片部分)链接到描述页面。另一部分(文本部分)链接到另一个类别的 URL。

    上面有 1 张图片,下面有一个文本链接,或者使用 标签来分割图片。

    在像烟花/织梦者这样的东西中很容易做到这一点。但是,如果您想打破一个好的老式文本编辑器,请参考文档:

    http://www.w3schools.com/TAGS/tag_map.asp

    【讨论】:

    • 这是因为图像打印了这个字符串的原因。因为在旧网站上,我使用图像地图完成了此操作,但我想用链接替换它,以便 SE 也可以索引此链接...感谢您的快速回复! ^^
    猜你喜欢
    • 2013-04-15
    • 1970-01-01
    • 2011-10-25
    • 2011-09-19
    • 1970-01-01
    • 1970-01-01
    • 2011-10-08
    • 2011-07-06
    • 1970-01-01
    相关资源
    最近更新 更多