参见英文答案 >
What is aria-label and how should I use it?3
我习惯于在我的链接/按钮/ …上使用title =“”属性来详细说明.但是,由于可理解的原因,引导程序使用了很多aria-label =“”属性,据我所知.
我习惯于在我的链接/按钮/ …上使用title =“”属性来详细说明.但是,由于可理解的原因,引导程序使用了很多aria-label =“”属性,据我所知.
所以我想起来创建如下的按钮:
<button id="show-raw-result" class="btn btn-default btn-sm btn-twigfiddle" title="Result was not easily readable so it has been automatically cleaned up,use this button to see the result raw" aria-label="Result was not easily readable so it has been automatically cleaned up,use this button to see the result raw"> <span class="glyphicon glyphicon-asterisk"></span> Show raw result </button>
解决方法
ARIA标签用于您网站的残疾游客. Bootstrap非常好,默认情况下它们支持它.
Accessible Rich Internet Applications (ARIA) defines ways to make Web
content and Web applications (especially those developed with Ajax and
JavaScript) more accessible to people with disabilities. For example,
ARIA enables accessible navigation landmarks,JavaScript widgets,form
hints and error messages,live content updates,and more.
资料来源:https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA
要回答你的问题,你应该使用哪一个,只使用标题属性.因为如果您的鼠标移动按钮并将标题文本显示为工具提示,则使用此属性.以这种方式不支持aria标签.