HTML-4

haechi·2021년 4월 1일
0

poiemaweb

목록 보기
5/13
post-thumbnail

210401-2

HyperText의 Hyper는 컴퓨터 용어로서 텍스트 등의 정보가 동일 선상에 있는 것이 아니라 다중으로 연결되어 있는 상태를 의미
하이퍼링크(hyper link) - 텍스트에서 다른 텍스트로 건너뛰어 읽을 수 있는 기능

<a href="http://www.naver.com">Visit naver.com!</a>

Visit naver.com!

1.href 어트리뷰트
이동하고자 하는 파일의 위치(경로)를 값으로 받는다.

  • 1.1 디렉터리(Directory)
    디렉터리는 파일과 다른 디렉터리를 갖는 파일 시스템 내의 존재물로서 폴더라고도 불리운다.
    - 루트 디렉터리
    파일 시스템 계층 구조상의 최상위 디렉터리
    Unix: /
    Windows: C:\
    - 홈 디렉터리
    시스템의 사용자에게 각각 할당된 개별 디렉터리
    Unix: /Users/{계정명}
    Windows: C:\Users{계정명}
    - 작업 디렉터리
    작업 중인 파일의 위치 디렉터리
    ./
    - 부모 디렉터리
    작업 디렉터리의 부모 디렉터리
    ../
  • 1.2 파일 경로(File path)
    파일 경로는 파일 시스템에서 파일의 위치를 나타내느 방법
    Absolute path
    루트 디렉터리를 기준으로 파일의 위치 나타냄
    http://www.mysite.com/index.html
    /Users/leeungmo/Desktop/myImage.jpg
    C:\users\leeungmo\Desktop\myImage.jpg
    /index.html
    Relative path
    현재 작업 디렉터리를 기준으로 상대적 위치를 가리킴
    ./index.html
    ../dist/index.js
    ../../dist/index.js
    index.html
    html/index.html

href 어트리뷰트에 사용 가능한 값은 아래와 같다.

Value Description

  • 절대 URL 웹사이트 URL (href=”http://www.example.com/default.html”)
  • 상대 URL 자신의 위치를 기준으로한 대상의 URL (href=”html/default.html”)
  • fragment identifier 페이지 내의 특정 id를 갖는 요소에의 링크 (href=”#top”)
  • 메일 mailto:
  • script href=”javascript:alert(‘Hello’);”

여기서 fragment identifier를 이용한 페이지 내부 이동 방법은 다음과 같다

<h2 id="top">Top of page!</h2>

~~~~~
<a href="#top">Go to top</a>

Top of page!

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.

Go to top

2.target 어트리뷰트
링크를 클릭했을 때 윈도우를 어떻게 오픈할 지를 지정

Value Description

  • _self : 링크를 클릭했을 때 연결문서를 현재 윈도우에서 오픈한다 (기본값)
  • _blank : 링크를 클릭했을 때 연결문서를 새로운 윈도우나 탭에서 오픈한다
<a href="http://www.google.com" target="_blank">Visit google.com!</a>

Visit google.com!

참고
https://poiemaweb.com/html5-tag-link

profile
공부중인 것들 기록

0개의 댓글