하이퍼링크(hyper link)란?
HTML의 가장 중요한 특징인 link의 개념과 연결되는데 기존 문서나 텍스트의 선형성, 고정성의 제약에서 벗어나 사용자가 원하는 순서대로 원하는 정보를 취득할 수 있는 기능을 제공
한 텍스트에서 다른 텍스트로 건너뛰어 읽을 수 있는 기능
HTML link는 hyperlink를 의미하며 a(anchor) tag가 그 역할을 담당
예제 ) 클릭시 google 사이트로 이동
<!DOCTYPE html>
<html>
<body>
<a href="http://www.google.com">Visit google.com!</a>
</body>
</html>
href 어트리뷰트
href 어트리뷰트는 이동하고자 하는 파일의 위치(경로)를 값으로 받는다. 경로(path)란 파일 시스템 상에서 특정 파일의 위치를 의미
디렉터리(Directory)
- 루트 디렉터리 ( 최상위 디렉터리 )
( Unix: / ) , ( Windows: C:\ )
- 홈 디렉터리 ( 사용자에게 각각 할당된 개별 디렉터리 )
( Unix: /Users/{계정명} ) , (Windows: C:\Users\{계정명})
- 작업 디렉터리 ( 작업 중인 파일의 위치한 디렉터리 )
( ./ )
- 부모 디렉터리 ( 작업 디렉터리의 부모 디렉토리 )
( ../ )
파일 경로(File path)
파일 경로는 파일 시스템에서 파일의 위치를 나타내는 방법
경로에는 절대경로와 상대경로가 있음
- 절대경로(Absolute path)
현재 작업 디렉터리와 관계없이 특정 파일의 절대적인 위치를 가리킨다.
루트 디렉터리를 기준으로 파일의 위치를 나타냄
ex)
- 상대경로(Relative path)
현재 작업 디렉터리를 기준으로 특정 파일의 상대적인 위치를 가리킴
ex)
fragment identifier
페이지 내부 이동 방법
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<h2 id="top">Top of page!</h2>
<a href="#bottom">⬇Go to bottom</a>
<p>In my younger and more vulnerable years my father gave me some advice that I've been turning over in my mind ever since.</p>
<p>"Whenever you feel like criticizing any one," he told me, "just remember that all the people in this world haven't had the advantages that you've had."</p>
<p>He didn't say any more, but we've always been unusually communicative in a reserved way, and I understood that he meant a great deal more than that. In consequence, I'm inclined to reserve all judgments, a habit that has opened up many curious natures to me and also made me the victim of not a few veteran bores. The abnormal mind is quick to detect and attach itself to this quality when it appears in a normal person, and so it came about that in college I was unjustly accused of being a politician, because I was privy to the secret griefs of wild, unknown men. Most of the confidences were unsought-frequently I have feigned sleep, preoccupation, or a hostile levity when I realized by some unmistakable sign that an intimate revelation was quivering on the horizon; for the intimate revelations of young men, or at least the terms in which they express them, are usually plagiaristic and marred by obvious suppressions. Reserving judgments is a matter of infinite hope. I am still a little afraid of missing something if I forget that, as my father snobbishly suggested, and I snobbishly repeat, a sense of the fundamental decencies is parcelled out unequally at birth.</p>
<p>And, after boasting this way of my tolerance, I come to the admission that it has a limit. Conduct may be founded on the hard rock or the wet marshes, but after a certain point I don't care what it's founded on. When I came back from the East last autumn I felt that I wanted the world to be in uniform and at a sort of moral attention forever; I wanted no more riotous excursions with privileged glimpses into the human heart. Only Gatsby, the man who gives his name to this book, was exempt from my reaction-Gatsby, who represented everything for which I have an unaffected scorn. If personality is an unbroken series of successful gestures, then there was something gorgeous about him, some heightened sensitivity to the promises of life, as if he were related to one of those intricate machines that register earthquakes ten thousand miles away. This responsiveness had nothing to do with that flabby impressionability which is dignified under the name of the "creative temperament"-it was an extraordinary gift for hope, a romantic readiness such as I have never found in any other person and which it is not likely I shall ever find again. No-Gatsby turned out all right at the end; it is what preyed on Gatsby, what foul dust floated in the wake of his dreams that temporarily closed out my interest in the abortive sorrows and short-winded elations of men.</p>
<p>And, after boasting this way of my tolerance, I come to the admission that it has a limit. Conduct may be founded on the hard rock or the wet marshes, but after a certain point I don't care what it's founded on. When I came back from the East last autumn I felt that I wanted the world to be in uniform and at a sort of moral attention forever; I wanted no more riotous excursions with privileged glimpses into the human heart. Only Gatsby, the man who gives his name to this book, was exempt from my reaction-Gatsby, who represented everything for which I have an unaffected scorn. If personality is an unbroken series of successful gestures, then there was something gorgeous about him, some heightened sensitivity to the promises of life, as if he were related to one of those intricate machines that register earthquakes ten thousand miles away. This responsiveness had nothing to do with that flabby impressionability which is dignified under the name of the "creative temperament"-it was an extraordinary gift for hope, a romantic readiness such as I have never found in any other person and which it is not likely I shall ever find again. No-Gatsby turned out all right at the end; it is what preyed on Gatsby, what foul dust floated in the wake of his dreams that temporarily closed out my interest in the abortive sorrows and short-winded elations of men.</p>
<p>And, after boasting this way of my tolerance, I come to the admission that it has a limit. Conduct may be founded on the hard rock or the wet marshes, but after a certain point I don't care what it's founded on. When I came back from the East last autumn I felt that I wanted the world to be in uniform and at a sort of moral attention forever; I wanted no more riotous excursions with privileged glimpses into the human heart. Only Gatsby, the man who gives his name to this book, was exempt from my reaction-Gatsby, who represented everything for which I have an unaffected scorn. If personality is an unbroken series of successful gestures, then there was something gorgeous about him, some heightened sensitivity to the promises of life, as if he were related to one of those intricate machines that register earthquakes ten thousand miles away. This responsiveness had nothing to do with that flabby impressionability which is dignified under the name of the "creative temperament"-it was an extraordinary gift for hope, a romantic readiness such as I have never found in any other person and which it is not likely I shall ever find again. No-Gatsby turned out all right at the end; it is what preyed on Gatsby, what foul dust floated in the wake of his dreams that temporarily closed out my interest in the abortive sorrows and short-winded elations of men.</p>
<p>And, after boasting this way of my tolerance, I come to the admission that it has a limit. Conduct may be founded on the hard rock or the wet marshes, but after a certain point I don't care what it's founded on. When I came back from the East last autumn I felt that I wanted the world to be in uniform and at a sort of moral attention forever; I wanted no more riotous excursions with privileged glimpses into the human heart. Only Gatsby, the man who gives his name to this book, was exempt from my reaction-Gatsby, who represented everything for which I have an unaffected scorn. If personality is an unbroken series of successful gestures, then there was something gorgeous about him, some heightened sensitivity to the promises of life, as if he were related to one of those intricate machines that register earthquakes ten thousand miles away. This responsiveness had nothing to do with that flabby impressionability which is dignified under the name of the "creative temperament"-it was an extraordinary gift for hope, a romantic readiness such as I have never found in any other person and which it is not likely I shall ever find again. No-Gatsby turned out all right at the end; it is what preyed on Gatsby, what foul dust floated in the wake of his dreams that temporarily closed out my interest in the abortive sorrows and short-winded elations of men.</p>
<a href="#top">⬆Go to top</a>
<h3 id="bottom">bottom of page!</h3>
</body>
</html>
http://localhost:63342/homework/test.html?_ijt=icjhf0bikhprd62pk0nict84km&_ij_reload=RELOAD_ON_SAVE#bottom
이동하고나면 주소창에 'http://... /#'가 입력되는 것을 확인
해쉬태그로 인해 이동한 위치가 주소창에 나타남
http://localhost:63342/homework/test.html?_ijt=icjhf0bikhprd62pk0nict84km&_ij_reload=RELOAD_ON_SAVE#top
위에 처럼 해쉬태그로 인해 이동한 위치가 주소창에 나타남
target 어트리뷰트
target 어트리뷰트는 링크를 클릭했을 때 윈도우를 어떻게 오픈할 지를 지정
Value | Description |
_self | 링크를 클릭했을 때 연결문서를 현재 윈도우에서 오픈 (기본값) |
_blank | 링크를 클릭했을 때 연결문서를 새로운 윈도우나 탭에서 오픈 |
target="_blank"를 사용해 외부 페이지를 오픈하는 경우, 이동한 외부 페이지에서 자바스크립트 코드를 사용해 악의적인 페이지로 리다이렉트할 수 있는 보안 취약점(Tabnabbing 피싱 공격)이 있음
따라서 rel="noopener noreferrer"를 추가해 Tabnabbing 피싱 공격에 대비할 것을 권장
_blank
<!DOCTYPE html>
<html>
<body>
<a href="http://www.google.com" target="_blank" rel="noopener noreferrer">Visit google.com!</a>
</body>
</html>
_self
<!DOCTYPE html>
<html>
<body>
<a href="http://www.google.com" target="_self" rel="noopener noreferrer">Visit google.com!</a>
</body>
</html>
'HTML' 카테고리의 다른 글
이미지의 표현과 동영상, 음악 등 멀티미디어를 지원하는 태그 (0) | 2023.01.27 |
---|---|
목록(List)와 표(Table) 형식 표현을 위한 태그 (0) | 2023.01.27 |
텍스트 관련 태그 (0) | 2023.01.26 |
웹페이지의 구성하는 기본 태그 (1) | 2023.01.26 |
HTML5 기본 문법 (0) | 2023.01.25 |