목차
- alt 예제 - <area> 태그 경우
- alt 정의
- alt 구문
- alt 예제 - <img> 경우
- alt 예제 - <input type="image"> 경우
alt 예제 - <area> 태그 경우
<img src="https://i.imgur.com/NUjTqSd.gif" width="389" height="26" border="0" usemap="#Search_Engine">
<map name="Search_Engine">
<area shape="rect" coords="4,3,68,21" href="http://naver.com" target="_blank" onFocus="blur()" alt="Naver">
<area shape="rect" coords="78,4,119,20" href="http://daum.net" target="_blank" onFocus="blur()" alt="Daum">
<area shape="rect" coords="128,5,193,19" href="http://www.paran.com" target="_blank" onFocus="blur()" alt="Paran">
<area shape="rect" coords="204,3,259,20" href="http://nate.com" target="_blank" onFocus="blur()" alt="Nate">
<area shape="rect" coords="269,2,323,20" href="http://www.google.co.kr/" target="_blank" onFocus="blur()" alt="Google">
<area shape="rect" coords="331,4,385,18" href="http://kr.yahoo.com/" target="_blank" onFocus="blur()" alt="Yahoo">
</map>
결과보기
alt 정의
이미지 표시 불가일 때, 이미지 대신 보여줄 대체 텍스트.
1. alt 속성 사용 가능 태그 종류
<area>, <img>, <input type="image">
2.
(웹표준/웹접근성) 위해 alt 속성은 꼭 사용.
3.
모든 브라우저 지원.
alt 구문
- <area alt="text">
- <img alt="text">
- <input type="image" alt="text">
[속성값]
text
해당 area 영역이나 이미지가 표시 안 될 때 보여줄 대체 텍스트 지정.
alt 예제 - <img> 경우
<img src="https://i.imgur.com/PQNhCln.gif" alt="양파맨 (협박)">
결과보기
alt 예제 - <input type="image"> 경우
<form action="/action_page.php">
<label for="name">이름:</label>
<input type="text" id="name" name="name">
<input type="image" src="https://i.imgur.com/PQNhCln.gif" alt="확인" width="56" height="56">
</form>
결과값