锚标记在 HTML5 网站中停止工作

发布于 2024-09-19 13:13:34 字数 1024 浏览 4 评论 0原文

我使用 HTML5 重置 作为编写 HTML5/CSS3 网站的基础。 但出于某种原因,除了 IE 之外,基本的锚标记不再可单击!

google 以 A 标记的正确颜色文本呈现,但没有应用悬停效果,指针没有改变,我无法点击链接。 当我检查 Firebug 时,它给了我以下信息:

 a {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:transparent none repeat scroll 0 0;
border:0 none;
color:#555555;
font-size:100%;
margin:0;
padding:0;
text-decoration:none;
text-transform:lowercase;
vertical-align:baseline;
}

*|*:link {
color:#0000EE;
}

*|*:-moz-any-link {
text-decoration:underline;
}

:-moz-any-link {
cursor:pointer;
}

所以我看不到任何值得注意的东西,它在 Chrome 和 Opera 中也是如此,所以我有点恼火。 我正在本地主机上进行开发,因此目前没有可发布的 URL,但呈现的 HTML 标记并不令人惊奇:

    <div id="copyanddesign">
        &copy; Someone 2010. 
        Design by <a href="http://www.google.com">google</a>
    </div>

欢迎提出任何建议!

谢谢

I'm using HTML5 reset as the basis for writing an HTML5/CSS3 website.
For some reason though, basic anchor tags are no longer clickable in anything other than IE!

<a href="http://www.google.com">google</a> renders in the correct colour text for A tags, but no hover effect is being applied, the pointer doesn't change and I cant click the link.
Firebug gives me the following when I inspect it:

 a {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background:transparent none repeat scroll 0 0;
border:0 none;
color:#555555;
font-size:100%;
margin:0;
padding:0;
text-decoration:none;
text-transform:lowercase;
vertical-align:baseline;
}

*|*:link {
color:#0000EE;
}

*|*:-moz-any-link {
text-decoration:underline;
}

:-moz-any-link {
cursor:pointer;
}

So nothing of note I can see, and it does the same in Chrome and Opera, so I'm a bit miffed.
Im developing on my local host so have no URL to post at present, but the HTML markup being rendered is nothing amazing:

    <div id="copyanddesign">
        © Someone 2010. 
        Design by <a href="http://www.google.com">google</a>
    </div>

Any suggestions most welcome!

Thanks

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

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

发布评论

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

评论(1

熟人话多 2024-09-26 13:13:34

谢谢。博宾斯是对的。这确实是一个 z-index 问题(虽然与 IE 无关,但跨所有浏览器)。结果发现另一个绝对定位的元素与它重叠,即使重叠部分是透明的,它仍然收到点击而不是超链接!
调整元素的高度,使其达到我需要的高度,现在链接可以正常工作

Thanks. bobince was correct. It was indeed a z-index issue (although not IE related, but across all browsers). Turned out another absolutely positioned element was overlapping it, and even though the overlapping part was transparent, it was still receiving the clicks rather than the hyperlinks!
Fiddled about with the height of the element to only make it as tall as I needed and now the link works

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