Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

What makes the user go to a specific location on a new html page? Not the current page. For example, when you click this link, you don't end up starting at the top like you normally would.

http://www.stanford.edu/dept/itss/docs/oracle/9i/java.920/a96654/basic.htm#1006509

share|improve this question

2 Answers 2

You can use internal anchors to define locations like so:

<a name="top"> </a>

<div>
    <p>Content Here</p>
</div>

<a href="#top">Back to Top</a> 
share|improve this answer

That's called an HTML anchor. Notice the #. The text AFTER that hash symbol is never actually sent to the server (in the GET request) so the server is only aware that you are visiting up to the '.htm' part. Your browser will look for anchors (take a look at the source) and scroll you down to that part.

In modern web design, anchors are used also in conjunction with JavaScript to load certain windows or messages.

share|improve this answer
    
Great explanation! Thank you. –  Mark Beleski Mar 15 '13 at 18:28

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.