gpt4 book ai didi

javascript - 如何使用 NVDA 屏幕阅读器读取工具提示?

转载 作者:行者123 更新时间:2023-12-01 08:33:27 26 4
gpt4 key购买 nike

我也尝试过这个,但它不起作用

<style>
/* Tooltip container */
.tooltip {
position: relative;
display: inline-block;
border-bottom: 1px dotted black; /* If you want dots under the hoverable text */
}

/* Tooltip text */
.tooltip .tooltiptext {
visibility: hidden;
width: 120px;
background-color: black;
color: #fff;
text-align: center;
padding: 5px 0;
border-radius: 6px;

/* Position the tooltip text - see examples below! */
position: absolute;
z-index: 1;
}

/* Show the tooltip text when you mouse over the tooltip container */
.tooltip:hover .tooltiptext {
visibility: visible;
}
</style>

here i have attache the code of simple tooltip , i want the tool-tip read by the screen reader i had also tried tabindex for focus but it not working
<div class="tooltip">Hover over me
<span class="tooltiptext">Tooltip text</span>
</div>

`

最佳答案

您必须使用 aria-scribedby 属性

<a href="#" aria-describedby="myinfo">Texto de el Link</a>
<div role="tooltip" id="myinfo">Contenido de el tooltip]</div>

关于javascript - 如何使用 NVDA 屏幕阅读器读取工具提示?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59712860/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com