How do I link to a location in the middle of an HTML document?
Submitted by: AdministratorFirst, label the destination of the link. The old way to label the destination of the link was with an anchor using the NAME attribute. For example:
<h2><a name="section2">Section 2: Beyond Introductions</a></h2>
The modern way to label the destination of the link is with an ID attribute. For example:
<h2 id="section2">Section 2: Beyond Introductions</h2>
Second, link to the labeled destination. The URL is the URL of the document, with "#" and the value of the NAME or ID attribute appended. Continuing the above examples, elsewhere in the same document you could use:
<a href="#section2">go to Section 2</a>
Similarly, in another document you could use:
<a href="thesis.html#section2">go to Section 2 of my thesis</a>
Submitted by: Administrator
<h2><a name="section2">Section 2: Beyond Introductions</a></h2>
The modern way to label the destination of the link is with an ID attribute. For example:
<h2 id="section2">Section 2: Beyond Introductions</h2>
Second, link to the labeled destination. The URL is the URL of the document, with "#" and the value of the NAME or ID attribute appended. Continuing the above examples, elsewhere in the same document you could use:
<a href="#section2">go to Section 2</a>
Similarly, in another document you could use:
<a href="thesis.html#section2">go to Section 2 of my thesis</a>
Submitted by: Administrator
Read Online HTML Job Interview Questions And Answers
Top HTML Questions
☺ | Explain Posting Copy and Paste HTML? |
☺ | What is a DOCTYPE? Which one do I use? |
☺ | How can I include comments in HTML? |
☺ | What is everyone using to write HTML? |
☺ | Do search engines dislike frames? |
Top Top World Wide Web Categories
☺ | Cascading Style Sheet CSS Interview Questions. |
☺ | HTML5 Interview Questions. |
☺ | Basic Internet Interview Questions. |
☺ | Domain Name System (DNS) Interview Questions. |
☺ | JavaScript Interview Questions. |