简体   繁体   中英

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.

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.

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. 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. 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;
} 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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