如何为可访问性目的设置焦点轮廓样式

时间:2018-01-03 22:58:58

标签: html css focus accessibility

我正在尝试在聚焦时调整场的轮廓,因为我目前的轮廓很难看到。我知道默认情况下一些html元素是可聚焦的,所以我不太确定要附加大纲样式的元素。

我是否需要定位所有可能具有焦点的元素?像

none

(包括所有其他元素)?这似乎不是正确的方法。

我已经尝试过寻找答案,我所能找到的是大纲不能是let cellId = "cellId" let headerId = "headerId" override func viewDidLoad() { super.viewDidLoad() collectionView?.backgroundColor = .white collectionView?.register(WordCell.self, forCellWithReuseIdentifier: cellId) collectionView?.register(UICollectionViewCell.self, forSupplementaryViewOfKind: UICollectionElementKindSectionHeader, withReuseIdentifier: headerId) } ,但除此之外,我还没有找到任何其他内容。

1 个答案:

答案 0 :(得分:1)

快去

:focus { outline: 1px solid white; } 

定位所有可聚焦元素。无需明确指定这些元素。

顺便说一句,这是

的缩写
*:focus {outline: 1px solid white; }
相关问题