• 회원가입
  • 로그인
  • 구글아이디로 로그인

[attribute] HTML - alt 속성 ★ - 이미지 표시 불가일 때 이미지 대신 보여줄 대체 텍스트 (= alt속성 = 올트속성) ※ (에어리어/이미지/인풋) 올트 속성

목차
  1. alt 예제 - <area> 태그 경우
  2. alt 정의
  3. alt 구문
  4. alt 예제 - <img> 경우
  5. 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>

 

결과값



분류 제목
style HTML - <aside> 태그 ★ - 관련 별도 콘텐츠 (= aside태그 = 어사이드태그)
style HTML - <details> 태그 - 토글 가능한 세부사항(상세사항)을 표시 (= details태그 = 디…
style HTML - <dialog> 태그 - 대화박스 (= 대화상자 = dialog태그 = 다이알로그태그) (HTM…
style HTML - <summary> 태그 - 세부사항의 머리글 (= summary태그 = 서머리태그 = 써머리태…
programming HTML - <embed> 태그 - 외부동영상재생 (= embed태그 = 엠베드태그, HTML5추가)
intro HTML - 구형브라우저에서 HTML5 사용 (+ HTML요소생성법)
deprecated HTML - <nobr> 태그 - 줄바꿈안하기 (= nobr태그 = 노비알태그)
etc HTML - <tt> 태그 - 텔레타이프 텍스트 (= tt태그 = 티티태그)
attribute HTML - Attribute ★ - 속성종류 (= 전역속성 + 이벤트속성 + 그외속성)
attribute HTML - Global Attribute - 전역속성 종류
attribute HTML - Event Attribute - 이벤트속성종류
api HTML5 - Geolocation - 사용자위치 (= 사용자 지리위치 = 지오로케이션)
api HTML5 - Drag and Drop - 마우스로 끌어서 놓기 (= 드래그앤드롭)
api HTML5 - Web Storage - 웹저장소 (= 웹스토리지) (IE8 이상) ※ 마우스 클릭횟수 점검
api HTML5 - Web Worker - 백그라운드실행JS (= 웹워커)
api HTML5 - Server-Sent Event - 서버전송이벤트 (= 서버센트이벤트)
etc HTML - 키보드 단축키 모음 (Window/Mac)
attribute HTML - lang 속성 ★ - 언어코드 (Language Code) + 국가코드 (Country Code…
etc HTML - 인터넷 (에러/오류) 의미 = (인터넷에러/인터넷오류) 종류 ★★★ + 500 Internal …
intro HTML - HTML5 사용조건 / HTML4.01과 다른점 (= HTML5 vs HTML401 차이점)
7/18
목록
찾아주셔서 감사합니다. Since 2012