January 13, 201214 yr Good morning fellow devs! I was just wondering if there is a way of when clicking on a link for say a 'contact page', the page loads but starts half way down that specific page? Any tips/advice would be much appreciated. Thanks James
January 13, 201214 yr You need to give the part of the page you are linking to an anchor <a name=""> then link to that including the relative page address and the name of the anchor.
January 13, 201214 yr I prefer to use an id rather than a name, like this:- Place this code at the position in the html file that you want to move a viewer from:- <a href="contact.html#anchorposition">Contact</a> and this code on the Contact page at the place which you want to appear at the top of the window:- <a id="anchorposition"></a> Or instead of the above you can use a convenient id that already exists in the correct place in the Contact page, like:- <h4 id="anchorposition">Sub-heading</h4> or <p id="anchorposition">Paragraph text............</p> Edited January 13, 201214 yr by Wickham
January 13, 201214 yr Author Like I said any advice or tips are greatly appreciated so thanks very much Wickham, all noted down!
Create an account or sign in to comment