TIL no.5 Links to a Named Anchor

이조은·2020년 6월 25일
0

TIL self-study

목록 보기
5/19
  • 동일 문서 안에서 링크 걸기를 원할 때, a엘레먼트는 다음과 같다
<a href="#Anchorname">linked text</a>

<a name="Anchorname">a named anchor</a>
Example of using the name attribute
<ul>
<li><a href="#a001">Jump to a001</a></li>
</ul>

<h3><a name="a001">a001</a></h3>


Example of using the id attribute
<ul>
<li><a href="#a001">Jump to a001</a></li>
</ul>

<h3 id="a001">a001</h3>
  • Create a named anchor
  1. 앵커 네임은 유니크해야한다.
  2. case-sensitive
  3. hyphen(-), underscore(_), colon(:), period(.) 포함될 수 있다
    예를 들어 name="anchor_name"
  4. 앵커 네임은 알파벳으로 시작해야한다.
    예를 들어 name="a001"
  • Link to a named anchor
  1. #와 앵커 네임을 입력한다
    예를 들어 href="#a001"
profile
싱글벙글

0개의 댓글