简体   繁体   English

如何防止 NVDA 公布链接的全部内容?

[英]How to prevent NVDA from announcing the whole content of a link?

I have a section of code that is contained in a link, the problem is that when I focus the element with NVDA the content of the link is read all at once.我有一段包含在链接中的代码,问题是当我使用NVDA聚焦元素时,链接的内容会被一次性读取。

For example I have this code:例如我有这个代码:

   <a href="example.html" title="description link">
     <h2>Heading H2</h2>
     <span>More Text</span>
     <p>More text</p>
   </a>

And when I focus the link with NVDA and Firefox the screen reader mention all the content of the h2 , span and p tags without press the arrow down key.当我用NVDA和 Firefox 聚焦链接时,屏幕阅读器会提到h2spanp标签的所有内容,而无需按向下箭头键。

Ideally, when focusing on the link just read the title of the link and when you press the down arrow key the rest of the content is read理想情况下,当专注于链接时,只需阅读链接的标题,当您按下向下箭头键时,将阅读其余内容

@brennanyoung is correct. @brennanyoung 是正确的。 Whatever is inside the anchor tag will be read by a screen reader.锚标签内的任何内容都将被屏幕阅读器读取。

If you wish to have the h2 span and p still clickable as if it were a link, but not read when an NVDA user places focus on it, you could use CSS to expand the clickable area to include the text below.如果您希望 h2 span 和 p 仍然可点击,就好像它是一个链接,但在 NVDA 用户将焦点放在它上面时无法读取,您可以使用 CSS 扩展可点击区域以包含下面的文本。 You'd likely need something in the anchor tag though.不过,您可能需要在锚标记中添加一些内容。 With more context I can provide a better example, but here's the idea有了更多的上下文,我可以提供一个更好的例子,但这里的想法

a {
    position: relative
}
.bigger:after{
    content:"";
    padding: 250px;  
    position: absolute;
    left: -25px;
    top: -25px;
} 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM