ie7 haslayout: -1 即使缩放:1

发布于 2024-11-29 23:59:19 字数 589 浏览 9 评论 0原文

我将锚点中的文本设置为 0 不透明度并绝对位于图像上方。我希望它们在悬停时部分显示,不透明度为 0.6,背景色。

在 IE 7 中,背景是不可点击的。我必须将鼠标悬停在文本应该显示的位置。背景颜色确实填充了具有固定宽度和高度的整个锚点。

我尝试了 Zoom: 1,但 IE7 仍然显示 haslayout: -1

a {
    color: #FFF;
    width: 250px;
    height: 113px;
    padding: 30px 15px;
    position: absolute;
    top: 0px;
    left: 0px;
    text-decoration: none;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
    filter: alpha(opacity=0);
    -moz-opacity: 0;
    -khtml-opacity: 0;
    opacity: 0;
}

一旦文本悬停在上面,似乎整个锚点都是可点击的。如果我的鼠标离开锚点并仅悬停在其背景上,则它将不起作用。

I have anchors with text in them set to 0 opacity and positioned absolutely above images. I want them to partially show on hover with 0.6 opacity with a background color.

In IE 7, the background is non-clickable. I have to hover where the text should be for it to show. The background color does fill the whole anchor which has a fixed width and height.

I tried zoom: 1, but IE7 still says haslayout: -1

a {
    color: #FFF;
    width: 250px;
    height: 113px;
    padding: 30px 15px;
    position: absolute;
    top: 0px;
    left: 0px;
    text-decoration: none;
    -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
    filter: alpha(opacity=0);
    -moz-opacity: 0;
    -khtml-opacity: 0;
    opacity: 0;
}

It seems as if the whole anchor is clickable once the text has been hovered over. If my mouse leaves the anchor and hovers over just its background, it won't work.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

银河中√捞星星 2024-12-06 23:59:19

  display: block;

如果你不想让它阻塞,那么宽度和高度就没有意义

在你的代码中。您还可以尝试添加

 z-index: 10;

There is missing

  display: block;

If you do not want to make it block, then width and height makes no sense.

in your code. You can also try to add

 z-index: 10;
不甘平庸 2024-12-06 23:59:19

没关系。解决了。锚点需要背景颜色才能使背景可点击。

Nevermind. Solved it. Anchor needed background color for background to be clickable.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文