HTML img 태그에는 alt 속성이 포함되어 있습니다. 이 속성은 이미지 이름, 이미지 링크, 이미지 작성자, 이미지 사양 등과 같은 이미지에 대한 정보를 지정합니다. 이 속성의 주요 목적은 인터넷 연결이 느릴 때 이미지가 로드되지 않을 수 있지만 문제 없이 로드되는 것입니다. 따라서 사용자가 페이지에서 돌아가는 대신 사용자가 페이지에서 커서를 이동하면 이미지와 관련된 일부 텍스트가 표시됩니다. 따라서 이 페이지에 내용이 있다는 것을 이해하고 페이지가 로드될 때까지 잠시 기다릴 수 있습니다.
실시간 시나리오: 웹에 이미지를 표시하는 동안 이미지의 내용을 모르는 최종 사용자에게는 공정하지 않습니다. 따라서 alt 속성을 사용하여 이미지에 일부 내용을 지정해야 합니다.
HTML에서 Alt 속성은 어떻게 작동하나요?
Alt 속성은 이미지의 의미를 인식할 수 있도록 이미지에 대한 대체 정보를 제공합니다. 이 속성은 텍스트만 허용합니다. 이 속성은 태그에서 사용할 수 있습니다:
이 3개의 태그 대체 속성은 이미지 위에 텍스트를 표시하는 데만 사용됩니다.
구문 #1 – 태그
<img src="/static/imghwm/default1.png" data-src="3.jpg" class="lazy" alt="text">
구문 #2 – 태그
<img src="/static/imghwm/default1.png" data-src="3.jpg" class="lazy" alt="text" usemap="#name"> //usemap name and map name attribute name must be same <map name="name"> <area coords="specify 4 coordinates" href="file.htm" alt="text"> </map> <input> tag
구문 #3 – 태그
<input type="image" alt="text">
HTML에 Alt 태그를 구현한 예
다음은 언급된 예입니다.
예시 #1
코드:
<meta charset="ISO-8859-1"> <title>Alt Attribute</title> <style type="text/css"> h1 { color: blue; text-align: center; } p { color: fuchsia; font-size: 20px; border: 2px solid red; } /*Aligning images side by side*/ * { box-sizing: border-box; } .column { width: 33.33%; padding: 5px; float: left; } .row::after { clear: both; display: table; content: ""; } </style> <h1 id="Alt-Attribute-Introduction">Alt Attribute Introduction</h1> <p>HTML img tag contains alt attribute. This attributes specifies the information about the image like image name, image link, image author, image specification etc. The main purpose of this attribute is when the internet connection is slow the image may not load but is loaded without any problem. So instead of user go back from the if user moved his cursor from the page it will display some text regarding image therefore he can understand that there is some content in this page and wait for some time until page is loaded.</p> <h1 id="Images-with-img-tag-and-alt-attribute">Images with img tag and alt attribute</h1> <div class="row"> <div class="column"> <img src="/static/imghwm/default1.png" data-src="3.jpg" class="lazy" alt="First Bird" style="max-width:90%"> </div> <div class="column"> <img src="/static/imghwm/default1.png" data-src="4.jpg" class="lazy" alt="Second Bird" style="max-width:90%"> </div> <div class="column"> <img src="/static/imghwm/default1.png" data-src="5.jpg" class="lazy" alt="Third Bird" style="max-width:90%"> </div> </div>
ì¶ë ¥:
ì´ë¯¸ì§ 리ìì¤ë¥¼ ì¬ì©í ì ìë ê²½ì°:
ì´ë¯¸ì§ 리ìì¤ë¥¼ ì¬ì©í ì ìë ê²½ì°:
ìì #2
ì½ë:
<meta charset="ISO-8859-1"> <title>Alt Attribute</title> <style type="text/css"> h1 { color: green; text-align: center; } p { color: navy; font-size: 20px; border: 2px solid orange; } </style> <h1 id="Alt-Attribute-Introduction">Alt Attribute Introduction</h1> <p>HTML img tag contains alt attribute. This attributes specifies the information about the image like image name, image link, image author, image specification etc. The main purpose of this attribute is when the internet connection is slow the image may not load but is loaded without any problem. So instead of user go back from the if user moved his cursor from the page it will display some text regarding image therefore he can understand that there is some content in this page and wait for some time until page is loaded.</p> <h1 id="Images-with-area-tag-and-alt-attribute">Images with area tag and alt attribute</h1> <img src="/static/imghwm/default1.png" data-src="d2.jpg" class="lazy" style="max-width:90%" style="max-width:90%" alt="HTMLì Alt íê·¸" usemap="#dog"> <map name="dog"> <area shape="rect" coords="0,0,81,125" href="https://www.educba.com/category/software-development/software-development-tutorials/python-tutorial/" alt="Python"> <area shape="circle" coords="91,59,4" href="https://www.educba.com/category/software-development/software-development-tutorials/java-tutorial/" alt="Java"> <area shape="circle" coords="125,59,9" href="https://www.educba.com/category/software-development/software-development-tutorials/bootstrap-tutorial/" alt="Bootstrap"> </map>
ì¶ë ¥:
ì´ë¯¸ì§ 리ìì¤ë¥¼ ì¬ì©í ì ìë ê²½ì°:
ì´ë¯¸ì§ 리ìì¤ë¥¼ ì¬ì©í ì ìë ê²½ì°:
ìì #3
ì½ë:
<meta charset="ISO-8859-1"> <title>Alt Attribute</title> <style type="text/css"> h1 { color: green; text-align: center; } p { color: navy; font-size: 20px; border: 2px solid orange; } label, input { color: green; font-size: 20px; } </style> <h1 id="Alt-Attribute-Introduction">Alt Attribute Introduction</h1> <p>HTML img tag contains alt attribute. This attributes specifies the information about the image like image name, image link, image author, image specification etc. The main purpose of this attribute is when the internet connection is slow the image may not load but is loaded without any problem. So instead of user go back from the if user moved his cursor from the page it will display some text regarding image therefore he can understand that there is some content in this page and wait for some time until page is loaded.</p> <h1 id="Images-with-input-tag-and-alt-attribute">Images with input tag and alt attribute</h1>
ì¶ë ¥:
ì´ë¯¸ì§ 리ìì¤ë¥¼ ì¬ì©í ì ìë ê²½ì°:
ì´ë¯¸ì§ 리ìì¤ë¥¼ ì¬ì©í ì ìë ê²½ì°:
ê²°ë¡
Altë Area, img, input íê·¸ìì ì¬ì©í ì ìë ìì±ì ëë¤. ì´ alt ìì±ì ì´ë¯¸ì§ë 무ìì¸ì§, ì´ë¯¸ì§ ì¢í, ì´ë¯¸ì§ ìì±ì ë±ê³¼ ê°ì ì´ë¯¸ì§ì ëí ì 보를 ì ê³µíë ë° ì¬ì©ë©ëë¤.
위 내용은 HTML의 Alt 태그의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

Theroottaginanhtmldocumentis.itservesasthetop-levellement thatenCapsulateslotherContent, 프로퍼 디코 언어 구조에있는 BrowserParsing을 보장합니다.

이 기사는 HTML 태그가 요소를 정의하는 데 사용되는 구문 마커이고 요소는 태그 및 내용을 포함한 완전한 단위라고 설명합니다. 그들은 웹 페이지를 구조화하기 위해 협력합니다. character count : 159

이 기사는 & lt; Head & gt의 역할에 대해 설명합니다. & lt; Body & Gt; HTML의 태그, 사용자 경험에 미치는 영향 및 SEO 영향. 적절한 구조화는 웹 사이트 기능 및 검색 엔진 최적화를 향상시킵니다.

이 기사는 HTML 태그, 등의 차이점과 시맨틱 대 프리젠 테이션 사용 및 SEO 및 접근성에 미치는 영향에 중점을 둡니다.

기사는 UTF-8에 중점을 둔 HTML에서 문자 인코딩 지정에 대해 논의합니다. 주요 이슈 : 올바른 텍스트 표시 보장, 멍청한 문자 방지 및 SEO 및 접근성 향상.

이 기사는 웹 컨텐츠를 구조화하고 스타일링하는 데 사용되는 다양한 HTML 서식 태그에 대해 논의하여 텍스트 모양에 미치는 영향과 접근성 및 SEO에 대한 시맨틱 태그의 중요성을 강조합니다.

이 기사는 고유성, 목적, CSS 구문 및 특이성에 중점을 둔 HTML의 'ID'와 '클래스'속성의 차이점에 대해 설명합니다. 웹 페이지 스타일링 및 기능에 어떤 영향을 미치는지 설명하고 모범 사례를 제공합니다.

이 기사는 스타일링 및 JavaScript 조작을위한 요소 그룹에서 HTML '클래스'속성의 역할을 고유 한 'ID'속성과 대조합니다.


핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

Video Face Swap
완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

인기 기사

뜨거운 도구

에디트플러스 중국어 크랙 버전
작은 크기, 구문 강조, 코드 프롬프트 기능을 지원하지 않음

SublimeText3 중국어 버전
중국어 버전, 사용하기 매우 쉽습니다.

WebStorm Mac 버전
유용한 JavaScript 개발 도구

ZendStudio 13.5.1 맥
강력한 PHP 통합 개발 환경

SublimeText3 Mac 버전
신 수준의 코드 편집 소프트웨어(SublimeText3)
