2016-11-04 98 views
0

屏幕閱讀器不讀這個div:如何讓NVDA屏幕閱讀器閱讀詠歎調標籤?

<div tabindex="7" aria-label="Here be redundant or extraneous content" > 

它應該閱讀「在這裏是多餘的或無關的內容」

任何幫助如何解決這個問題,HTML?

+0

爲了給你一個很好的答案,如果你有一個問題,如果你還沒有看過,它可能會幫助我們。如果你可以提供[mcve],它可能也很有用。 – Mat

+1

不鼓勵爲tabindex使用正值。 –

回答

0

A div既不是地標也不是互動內容。一個aria-label將不會被屏幕閱讀器讀取(正確如此)。

使用脫屏技術:

<div class="sr-only"> 
Here be redundant or extraneous content 
</div> 

的CSS可能是這樣的(佔RTL語言太):

.SRonly { 
    position: absolute !important; 
    clip: rect(1px 1px 1px 1px); /* IE6, IE7 */ 
    clip: rect(1px, 1px, 1px, 1px); 
    top: auto; 
    left: -9999px; 
    width: 1px; 
    height: 1px; 
    overflow: hidden; 
} 

html[dir=rtl] .SRonly { 
    left: inherit; 
    left: unset; 
    right: -9999px; 
} 

There are other techniques,但它們的價值取決於你的觀衆和技術簡介。

此外,never use a positive tabindex value。並且never use a div as interactive content(製表符意味着你的意圖)。

未來,如果您提供了一個您嘗試解決的挑戰的示例和說明,您的問題可能會得到更多關注。