Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I post a link, I want to make sure the page opens at a particular place on the page by editing the URL. Is there a simple way to do that?

I must say I figured this was a simple enough question that a few minutes of googling should be enough to solve, but this has proven to not be the case. I'm hoping you all can help me out.

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

Generally it's pretty easy, you would append a hash (#) and the id of an element (generally in the HTML you would see <div id="something"> and you would use #something.

As an example on this page:

http://superuser.com/questions/627193/how-do-i-edit-a-url-so-that-it-forces-you-to-a-particular-spot-on-the-page-it-op#answers

I had to right click and inspect the element to see the id, it helps to have the developer tools/firebug/etc installed and activated (on Firefox/Chrome).

On Safari, you'd need to turn on the dev console I believe.

On Internet Explorer, you probably have to manually search - but someone else may have a suggestion there.

share|improve this answer
    
I've been using the web since there was a web, and I did not know this. I knew about anchors, but not the div id trick. Thanks! –  MattDMo Aug 2 '13 at 19:13
add comment

If it concerns a page you wrote, (or if they are already present) you can use HTML anchors.

Otherwise, it's not possible to give a location in a webpage in the URL.

share|improve this answer
    
not true - see nerdwaller's answer... –  MattDMo Aug 2 '13 at 19:11
    
@MattDMo This debate has already occurred (even if the comments were deleted), and we are both telling the same thing : the only way to achieve what the asker wants are HTML anchors. And if there are no anchors already on the page, you can't create such link. –  Levans Aug 2 '13 at 19:19
    
You're right, I should have read through your link more carefully. I can't undo my vote (time limit), but if you make a minor edit to your post I will gladly change it. My bad... –  MattDMo Aug 2 '13 at 19:21
add comment

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.