Firefox 锚点大纲问题

发布于 2024-12-15 08:19:25 字数 1108 浏览 3 评论 0原文

下面的代码片段让我很头疼。

<div id="links-container">
  <ul>
    <li class="resource-link li-sep"><a href="http://www.somesite.com/members/category/?catID=8" target="_blank"><em>Enjoy family-friendly</em>ACTIVITIES AND ATTRACTIONS <span>&raquo;</span></a></li>
    <li>...etc...</li>
  </ul>
</div>

我在 CSS 中尝试过这个,但没有任何效果;

#links-container ul li a { color:#C28234; }
#links-container ul li a span { font-size:140%; line-height:1em; }
#links-container ul li a em { display:block; font-family:Georgia; font-weight:normal; margin-bottom:-6px; }
#links-container ul li a:focus em, #links-container ul li a:active em { outline:none; }
#links-container ul li a:hover { color:#75450A; }

发生的情况是,在 Firefox 中,当您通过选项卡浏览链接时,它会在两组文本周围创建轮廓,这些文本彼此非常接近并导致轮廓重叠。

我们的项目经理希望保留大纲以促进可访问性。

如果您在 Chrome 中查看它,它将把锚点的全部内容包裹在一个大纲中。我们认为这是完美的。我的问题是,可以做些什么来在 Firefox 中复制这一点吗?或者至少,清理它,这样当 Firefox 单独勾画同一链接中的每个文本项时,轮廓就不会看起来像粪便。

还有其他人需要处理这个问题吗?如果有的话,你是怎么克服的?

谢谢

The following snippet is causing me a QA headache.

<div id="links-container">
  <ul>
    <li class="resource-link li-sep"><a href="http://www.somesite.com/members/category/?catID=8" target="_blank"><em>Enjoy family-friendly</em>ACTIVITIES AND ATTRACTIONS <span>»</span></a></li>
    <li>...etc...</li>
  </ul>
</div>

I tried this in CSS, but nothing is working;

#links-container ul li a { color:#C28234; }
#links-container ul li a span { font-size:140%; line-height:1em; }
#links-container ul li a em { display:block; font-family:Georgia; font-weight:normal; margin-bottom:-6px; }
#links-container ul li a:focus em, #links-container ul li a:active em { outline:none; }
#links-container ul li a:hover { color:#75450A; }

What's happening is that in Firefox, when you tab through the links, it's creating outlines around both sets of text which have close proximity to each other and are causing overlapping outlines.

Our project mgrs wish to keep the outlines to promote accessibility.

If you view it in Chrome, it will wrap the entire contents of the anchor in an outline. And we consider this to be perfect. My question is, can something be done that can replicate this in Firefox. Or at the very least, clean it up so that the outline doesn't look like dung when Firefox individually outlines each text item in the same link.

Anyone else ever have to deal with this? If so, how'd you get past it?

Thanks

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

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

发布评论

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

评论(2

时光与爱终年不遇 2024-12-22 08:19:25

出色地。这是一个部分解决方案,但可以适用于您的情况。如果您对菜单项有疑问,则只能应用“display: inline-block;”到这里的链接,使其具有共同的轮廓。

示例: jsfiddle.net/zDbsQ/2/

编辑:修复了示例链接,原始链接错误。

Well. It's a partial solution, but can work in your case. If you you have problem with menu items only you can apply "display: inline-block;" to links in here, to make it have a common outline.

Example: jsfiddle.net/zDbsQ/2/

EDIT: Fixed link to example, original was wrong.

你在看孤独的风景 2024-12-22 08:19:25

您可以使用:

#links-container ul li a *{ outline: none; }

这将选择 a 中的所有元素并禁用轮廓。

You can just use:

#links-container ul li a *{ outline: none; }

This will select all elements within an a and disable the outline..

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