스크린리더 고려해서 html 마크업으로 글씨는 써두되, 화면 상에서 bg에 먹인 아이콘만 보이고 싶을 때 쓰는 방법
text-indent 사용
<a href="#" class="bg_only">유투브</a>
bg_only { text-indent: -1000px; background: url('assets/youtube_icon.png') no-repeat center; background-size: 24px auto; }
'Coding > HTML+CSS' 카테고리의 다른 글
[CSS] img 사이즈 조절 시 흐려지는 현상 (0) | 2021.12.21 |
---|---|
[CSS] text에 그라데이션 먹이기 (1) | 2021.09.30 |
[CSS] IE에서 flexbox 이미지 버그 해결방법 (0) | 2021.07.07 |
[CSS] counter()로 넘버링하기 (0) | 2021.06.18 |
[CSS] background-image를 animation처럼 변경하는 방법 (0) | 2021.06.18 |