Skip to content

Instantly share code, notes, and snippets.

@roatnek
Last active April 10, 2018 03:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roatnek/c24d5257c4f6d5b1ef0f2328609a0221 to your computer and use it in GitHub Desktop.
Save roatnek/c24d5257c4f6d5b1ef0f2328609a0221 to your computer and use it in GitHub Desktop.
視覚的に隠すアクセシブルな方法
/*
視覚的に隠しつつスクリーンリーダーでは読み上げられる。
display:none, visibility:hidden, height:0, width:0 ではうまく機能しない(視覚・聴覚両方で該当要素は利用できない)
(インクルーシブHTML P.75より)
*/
.visually-hidden {
position: absolute;
width: 1px;
height: 1px;
overflow: hidden;
clip: rect(1px, 1px, 1px, 1px);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment