๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๐Ÿ‘ฉ๐Ÿป‍๐Ÿ’ปSTUDY/Publishing

์›น์ ‘๊ทผ์„ฑ์„ ์œ„ํ•œ ํ…์ŠคํŠธ ์ˆจ๊น€ ์ฒ˜๋ฆฌ(blind text)

๋ฐ˜์‘ํ˜•

์‚ฌ์šฉ์ด์œ !

display: none ์ด ์•„๋‹Œ ์ ‘๊ทผ์„ฑ์„ ๊ณ ๋ คํ•ด ์ˆจ๊น€์ฒ˜๋ฆฌํ•œ๋‹ค.

 

.hide {
    position: absolute;
    top: -9999px;
    left: -9999px;
    text-index: -9999px;
    width: 1px;
    height: 1px;
}

์œ„์™€ ๊ฐ™์€ ๊ฒฝ์šฐ ์ ‘๊ทผ์„ฑ์— ๋ฌธ์ œ๋ฅผ ์ผ์œผํ‚จ๋‹ค.

text-indent์˜ ๊ฒฝ์šฐ, ์•ต์ปคํƒœํฌ(<a href="/">)๋‚˜ html5์—์„œ ๋Œ€ํ™”ํ˜• ์š”์†Œ๋“ค์—์„œ ์ดˆ์ ์„ document ๋ฐ–์— ์žก์•„๋ฒ„๋ฆฌ๋Š” ๋ฌธ์ œ์ ์ด ์žˆ๋‹ค.

 

๋ณด์ด์ง€ ์•Š๋Š” ๊ณณ์— ์ดˆ์ ์ด ๋‚˜๊ฐ€๋Š” ๊ฒƒ์€ ์ ‘๊ทผ์„ฑ์— ์œ„๋ฐ˜๋˜๋ฏ€๋กœ, ์ˆจ๊น€ํ…์ŠคํŠธ๋ฅผ ์‚ฌ์šฉํ•˜๊ณ ์ž ํ•  ๋•Œ ๋ถ€์ ํ•ฉํ•˜๋‹ค.

 

.blind {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
}

ํ•˜๋Š” ๊ฒƒ์ด ์ข‹๋‹ค.

 

์ˆจ๊ธฐ๊ธฐ ์ฝ”๋“œ๋ฅผ ์„ค๋ช…

position: absolute :: clip์ด absolute, fixed ์ผ ๋•Œ๋งŒ ์ ์šฉ๊ฐ€๋Šฅํ•˜๊ธฐ ๋•Œ๋ฌธ. + ๋ ˆ์ด์•„์›ƒ์— ์˜ํ–ฅ ๋ฏธ์น˜์ง€ ์•Š๊ธฐ ์œ„ํ•ด.

width: 1px, height: 1px :: ์Šคํฌ๋ฆฐ๋ฆฌ๋”๊ธฐ๊ฐ€ ์ฝ์„ ์ˆ˜ ์žˆ๋„๋ก.

padding: 0 :: ์ƒ์†๋˜๊ฑฐ๋‚˜ ์ ์šฉ๋  ์ˆ˜ ์žˆ๋Š” ์Šคํƒ€์ผ์„ ์ œ๊ฑฐ.

border: 0 :: ์ƒ์†๋˜๊ฑฐ๋‚˜ ์ ์šฉ๋  ์ˆ˜ ์žˆ๋Š” ์Šคํƒ€์ผ์„ ์ œ๊ฑฐ. border:none๊ณผ border: 0์€ ๋‹ค๋ฅด๋‹ค. none์œผ๋กœ ํ–ˆ์„ ๋•Œ border-style์„ ์ ์šฉํ–ˆ์„ ๊ฒฝ์šฐ ์šฐ์„ ์ˆœ์œ„๋กœ ์ธํ•ด border: none์ธ๋ฐ๋„ ํ…Œ๋‘๋ฆฌ๊ฐ€ ์ƒ๊ธด๋‹ค. ๊ทธ๋Ÿฌ๋ฏ€๋กœ ์•ˆ์ „ํ•˜๊ฒŒ border: 0์„ ์‚ฌ์šฉ.

margin: -1px :: ๋ถ€๋ชจ ์š”์†Œ ๋ฐ–์œผ๋กœ ์œ„์น˜์‹œํ‚ด.

overflow: hidden :: overflow๋œ ์ฝ˜ํ…์ธ  ์ˆจ๊ธฐ๊ธฐ.

clip: rect(0, 0, 0, 0) :: top๊ณผ bottom, left์™€ right๊ฐ€ ๊ฐ™์€ ๊ฐ’์ด๋ฉด ์š”์†Œ๊ฐ€ ์ˆจ๊ฒจ์ง„๋‹ค.

 

 

 

 


 

Reference

https://nm817.tistory.com/42

https://codingsalon.tistory.com/62

 

 


[21.12.21 ์ถ”๊ฐ€]

https://webaim.org/techniques/css/invisiblecontent/#techniques

 

WebAIM: CSS in Action - Invisible Content Just for Screen Reader Users

CSS in ActionInvisible Content Just for Screen Reader Users You are here: Home > Articles > CSS in Action: Invisible Content Just for Screen Reader Users Article Contents Introduction Techniques for hiding text Examples Instructional cues and indicators "S

webaim.org

 

 

๋ฐ˜์‘ํ˜•