HTML의 href 태그
HTML href는 하이퍼텍스트 참조로 축약됩니다. 이는 앵커() 태그 내에서 사용할 수 있는 속성입니다. 이 href는 www.google.com, www.gmail.com, www.facebook.com 등과 같은 웹사이트 URL에 사용됩니다.
실시간 예: 우리는 일상생활에서 수많은 웹사이트에 접속했습니다. 우리가 이 웹사이트 URL에 어떻게 접근할지 생각해 본 적이 있나요? href 태그 덕분에 우리는 어떤 웹사이트 URL에도 접근할 수 있습니다. 우리는 href 속성의 큰따옴표(href=”website”) 안에 웹사이트가 필요했습니다.
HTML에서 href 속성은 어떻게 작동하나요?
HTML href 속성은 사용 중인 href 태그에 따라 작동합니다. 사용 가능한 모든 href 태그 목적은 웹 URL에 액세스하는 데 동일하지만 약간의 차이가 있습니다.
href 속성을 허용하는 태그가 4개 있습니다. 그들은:
1. : 이 태그는 href 속성 내에서 링크가 이동해야 하는 페이지의 URL을 지정하는 데 사용됩니다.
구문:
<a href="URL%20link"></a>
2. : 이 태그는 href 속성 내에서 링크가 이동해야 하는 페이지의 URL을 지정하는 데 사용됩니다.
구문:
<area href="URL%20link">
3.
구문:
<base href="Base%20URL%20link">
4. : 이 태그는 href 속성 내에서 styles.css, javascript.js 등과 같은 외부 파일 위치를 지정하는 데 사용됩니다.
구문:
<link href="external%20link">
HTML에서 href 태그를 구현하는 예
다음은 다양한 예입니다.
예 #1 – href 속성이 있는 태그
코드:
<title>href attribute</title> <!--CSS code--> <style> p { color: green; border: 2px solid brown; font-size: 22px; } h1 { color: blue; text-align: center; } </style> <h1>The <a> tag with href attribute introduction</a> </h1> <p>HTML href is abbreviated as hypertext reference. This is the attribute which is available inside the anchor (<a>) tag. This href is used for website URLs like www.google.com, www.gmail.com, www.facebook.com etc.</a></p> <p>Real time Example: Day to day life we have accessed so many websites. Have you ever think about how would we access this website URLs? Because of href tag we can access any website URLs. We simply required website within this double quotes (href="website") of href attribute. </p> <h1>The <a> tag with href attribute URLs</a> </h1>
출력:
예 #2 – href 속성이 있는 태그
코드:
<title>href attribute</title> <!--CSS code--> <style> p { color: fuchsia; border: 2px solid orange; font-size: 22px; } h1 { color: red; text-align: center; } </style> <h1>The <a> tag with href attribute introduction</a> </h1> <p>HTML href is abbreviated as hypertext reference. This is the attribute which is available inside the anchor (<a>) tag. This href is used for website URLs like www.google.com, www.gmail.com, www.facebook.com etc.</a></p> <p>Real time Example: Day to day life we have accessed so many websites. Have you ever think about how would we access this website URLs? Because of href tag we can access any website URLs. We simply required website within this double quotes (href="website") of href attribute. </p> <h1 id="The-area-tag-with-href-attribute-URLs-Example">The <area> tag with href attribute URLs Example</h1> <img src="/static/imghw/default1.png" data-src="planets.gif" class="lazy" style="max-width:90%" style="max-width:90%" alt="HTML의 href 태그" usemap="#educba"> <map name="educba"> <!--Click on this coordinate gives you that images--> <area shape="rect" coords="0,0,81,125" href="sun.htm"> <area shape="circle" coords="91,59,4" href="mercur.htm"> <area shape="circle" coords="125,59,9" href="venus.htm"> </map>
출력:
클릭 후
예 #3 – href 속성이 있는 태그
코드:
<title>href attribute</title> <!--From this path image is loaded--> <base href="https://www.w3schools.com/images/"> <!--CSS code--> <style> p { color: navy; border: 2px solid blue; font-size: 22px; } h1 { color: fuchsia; text-align: center; } </style> <h1>The <a> tag with href attribute introduction</a> </h1> <p><img src="/static/imghw/default1.png" data-src="stickman.gif" class="lazy" style="max-width:90%" style="max-width:90%" alt="HTML의 href 태그" > HTML href is abbreviated as hypertext reference. This is the attribute which is available inside the anchor (<a>) tag. This href is used for website URLs like www.google.com, www.gmail.com, www.facebook.com etc.</a></p> <p>Real time Example: Day to day life we have accessed so many websites. Have you ever think about how would we access this website URLs? Because of href tag we can access any website URLs. We simply required website within this double quotes (href="website") of href attribute. </p>
출력:
예시 #4 – href 속성이 있는 태그
코드:
<title>href attribute</title> <!--Including external CSS styles file with link tag--> <link rel="stylesheet" type="text/css" href="styles.css"> <h1>The <a> tag with href attribute introduction</a> </h1> <p>HTML href is abbreviated as hypertext reference. This is the attribute which is available inside the anchor (<a>) tag. This href is used for website URLs like www.google.com, www.gmail.com, www.facebook.com etc.</a></p> <p>Real time Example: Day to day life we have accessed so many websites. Have you ever think about how would we access this website URLs? Because of href tag we can access any website URLs. We simply required website within this double quotes (href="website") of href attribute. </p>
CSS 코드: styles.css
p { color: red; border: 2px solid green; font-size: 22px; } h1 { color: orange; text-align: center; }
출력:
결론
hrefin HTML은 웹 URL에 액세스하는 데 사용됩니다. href 속성을 허용하는 태그는 , , 입니다. 및 . 가장 자주 및 태그가 사용됩니다.
추천기사
HTML의 href 태그에 대한 안내입니다. 여기에서는 코드 구현 및 출력과 함께 HTML의 href 태그 소개 및 해당 예제에 대해 설명합니다. 자세한 내용을 알아보려면 추천 기사를 살펴보세요.
- HTML에서 Span 태그의 상위 15가지 속성
- HTML에서 div 태그는 어떻게 작동하나요?
- HTML 검색창 | 예시
- HTML의 캔버스 태그 | 예시
위 내용은 HTML의 href 태그의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

핫 AI 도구

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

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

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

Clothoff.io
AI 옷 제거제

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

인기 기사

뜨거운 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

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

스튜디오 13.0.1 보내기
강력한 PHP 통합 개발 환경

드림위버 CS6
시각적 웹 개발 도구

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

HTML의 테이블 테두리 안내. 여기에서는 HTML의 테이블 테두리 예제를 사용하여 테이블 테두리를 정의하는 여러 가지 방법을 논의합니다.

HTML의 Nested Table에 대한 안내입니다. 여기에서는 각 예와 함께 테이블 내에 테이블을 만드는 방법을 설명합니다.

HTML 여백-왼쪽 안내. 여기에서는 HTML margin-left에 대한 간략한 개요와 코드 구현과 함께 예제를 논의합니다.

HTML 테이블 레이아웃 안내. 여기에서는 HTML 테이블 레이아웃의 값에 대해 예제 및 출력 n 세부 사항과 함께 논의합니다.

HTML 입력 자리 표시자 안내. 여기서는 코드 및 출력과 함께 HTML 입력 자리 표시자의 예를 논의합니다.

HTML 순서 목록에 대한 안내입니다. 여기서는 HTML Ordered 목록 및 유형에 대한 소개와 각각의 예에 대해서도 설명합니다.

HTML onclick 버튼에 대한 안내입니다. 여기에서는 각각의 소개, 작업, 예제 및 다양한 이벤트의 onclick 이벤트에 대해 설명합니다.

HTML에서 텍스트 이동 안내. 여기서는 Marquee 태그가 구문과 함께 작동하는 방식과 구현할 예제에 대해 소개합니다.
