在 GitHub 上檢視
螢幕閱讀器
使用螢幕閱讀器工具在所有裝置上隱藏元素,螢幕閱讀器除外。
使用 .sr-only
隱藏所有裝置的元素,螢幕閱讀器除外。將 .sr-only
與 .sr-only-focusable
結合使用,讓元素在取得焦點時再次顯示(例如,僅使用鍵盤的使用者)。也可以用作混合。
<a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>
// Usage as a mixin
.skip-navigation {
@include sr-only;
@include sr-only-focusable;
}