How Do I Link To A Location In The Middle Of An HTML Document

How Do I Link To A Location In The Middle Of An HTML Document


  • 26 Feb, 2012

    First, 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>

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.