CSS的用户选择和可访问性 [英] CSS' user-select and accessibility

查看:48
本文介绍了CSS的用户选择和可访问性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我使用以下内容:

-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;

我可以禁用网页上某些元素的文本选择.对于按钮和链接,如果选择的话,它们不能提供很好的用户体验(显然是这样).

I can disable text selection of certain elements on my web page. Works well for buttons and links which don't give as nice a UX if selected (obviously opinion).

我可以在需要的地方随意使用它吗?还是对可访问性有影响?即屏幕阅读器和其他工具是否依赖文本选择?

Am I free to use this wherever I feel necessary? Or are there accessibility implications? i.e. do screen readers and other tools rely on text selection?

注意:我不是在征询 user-select 属性的使用方面的意见,而是在寻找受其影响的可访问性级别的事实.

Note: I'm not asking for opinion on the usage of user-select attributes, I'm looking for facts on levels of accessibility being affected by it.

推荐答案

屏幕阅读器和其他工具依赖于您发送的基本HTML文档.因此,使内容无法选择不会产生任何效果,就像其他样式效果无关紧要.

Screen readers and other tools rely on the base HTML document that you send along. As such, making things unselectable should not have an effect, just as other styling effects wouldn't matter.

JAWS和其他屏幕阅读器的工作原理是掠过HTML文档并为用户创建诸如DOM模型之类的内容.在Internet上使用它们要求人们对标题和段落标签有所了解,因此用户将已经了解应该编写网站的方式.通常,视力障碍的用户会浏览标题,就像视力障碍的人浏览Wikipedia文章时一样,在找到想要的部分时停下来,并命令屏幕阅读器阅读下面的下一段.因此,正确布置HTML至关重要,这样屏幕阅读器才能从上到下阅读它.

JAWS and other screen readers work by skimming HTML documents and creating something like a DOM model for the user to move through. Using them on the internet requires that one know a bit about headings and paragraph tags, so a user will already understand the way websites are supposed to be written. Often, a sightless user will skim through the headings, much like how a sighted person would skim through a Wikipedia article, stopping when they find the section they want, and ordering the screen reader to read the next paragraph below. For this reason, it's important to lay out your HTML correctly, so that a screen reader can read it top to bottom.

有关更多信息,并考虑到您的网站建设,我将阅读以下链接,介绍如何为能力各异的人提供服务

for more information, and for building your website with inclusion in mind, I would read the following links on how to provide for the differently abled

http://www.w3.org/WAI/intro/人们使用网络/故事

http://www.w3.org/WAI/guid-tech.html ,特别是如何满足WCAG 2.0"

http://www.w3.org/WAI/guid-tech.html , Especially "How to Meet WCAG 2.0"

http://www.paciellogroup.com/blog/2008/03/how-jaws-reads-text/

关于其他可访问性问题,我知道很多人喜欢阅读网站,方法是突出显示他们正在阅读的段落的粗略句子,然后是下一部分,依此类推.使大文本段落不可读(尽管我认为您提到过您不会这样做)可能会使某人的工作流出现某种问题,但是再次,什么不是?

As for other accesibility implications, I know plenty of people who like to read websites by highlighting a roughtly sentence long section of the paragraph they are reading, then the next section, and so on. Making large text paragraphs unreadable (although I think you mentioned you wouldn't do this) would probably make some sort of issue with someone's workflow, but then again, what doesn't?

这篇关于CSS的用户选择和可访问性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆