Solved

How to link a page

Posted on 2012-12-23
5
288 Views
Last Modified: 2012-12-27
How can I cause a link to a page to open the page and show the area of the page that contains that section.  For example, a page has 5 sections and the user is on some other page and the click a link that takes them to the area of the page and shows section 4 instead of just sitting at the top of the page.

How is this done?

Thanks
0
Comment
Question by:tf2012
5 Comments
 
LVL 23

Assisted Solution

by:tailoreddigital
tailoreddigital earned 75 total points
ID: 38717397
0
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 350 total points
ID: 38717606
Actually that link is detailing the obsolete way of doing it.  In a modern page any id can be used as an anchor.  If you have"

<section id="mytarget">

the an url  like

href="http://www.mysite/mypage.html#mytarget"

will put the target section at the top of the page.

Any element can be targeted using the id.  Most commonly the heading tags are used.

Cd&
0
 
LVL 11

Assisted Solution

by:mcnute
mcnute earned 75 total points
ID: 38718570
Actually anchors work like this.

On the page where you want the user to land on after the click, you need to put an
<a name="section4">Section 4</a>

Open in new window

link where section 4 actually begins.

When the user clicks the url from the referral page:
http://the-domain-to-land-on.com/the-page-to-land-on.html#section4

Open in new window


He'll be directly landing in section 4 of the page.

Hope I got that clearly explained.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 38718784
As I already stated the anchor form of the a tag is obsolete.

For backward compatibility the modern browsers will still find an anchor using name, but with additional overhead because they will look for id first.  

All new development and maintenance should not be using obsolete formats.

Please read the specification and follow best practice with current standards applied.

Cd&
0
 
LVL 1

Author Closing Comment

by:tf2012
ID: 38724895
Thanks for the info!
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question