IE7无法在文本上渲染链接(带背景透明)? [英] IE7 Can't render link (with background transparent) over a text?

查看:90
本文介绍了IE7无法在文本上渲染链接(带背景透明)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码

<div class="container">
    <div class="myBox">My Text</div>        
    <a class="myLink" href="http://www.google.com">&nbsp;</a>       
</div>    ​



CSS:



CSS :

.container
{
    position:relative;
    width:200px;
    height:200px;
}

.myBox
{
    position:absolute;
    top:0;
    left:0;
    z-index:90;
    background-color:#ff0000;
    width:200px;
    height:200px;    
}

.myLink
{
    text-decoration:none; 
    display:block; 
    position:absolute; 
    width:50px; 
    height:50px; 
    top:0px; 
    left:0px; 
    z-index:100;
}​

在IE7上,链接My text如果,在 myLink 我把一个背景颜色,它的工作原理。

on IE7, the link over "My text" doesnt work as link. If, on myLink I put a background-color, it works as well.

我是药物还是这是正常的行为?

Am I on drugs or it is a normal behaviour? And how can I fix this with a transparent background?

推荐答案

尝试将这些行添加到 .myLink

background-color:#ff0000;
filter: alpha(opacity=0);

EDIT

如果 .myBox 中只有一个图像,则 .myLink 将如预期工作,如果图像作为背景图片添加到 .myBox

If there will be only an image in .myBox, .myLink will work as expected, if the image is added as a background image to .myBox.

这篇关于IE7无法在文本上渲染链接(带背景透明)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆