HTML "a name" question from third party site - Query

M

Miles Davenport

I am getting confused about HTML "a name".

I have a webpage "foo.html, and have:

<a name="5xp">

In the html, if I click on a link on that page - it works fine.

BUT, if I try and refer to the a name from another site:

<A href="http://www.mysite.com/page.html?5xp>clickHere</A> - It doesn't
refer to the aname, but always goes to the top of the page.

Can someone please tell me what I am doing wrong.

Many thanks.

Miles.
 
P

picayunish

Miles Davenport wrote in
I am getting confused about HTML "a name".

I have a webpage "foo.html, and have:

<a name="5xp">

In the html, if I click on a link on that page - it works fine.

BUT, if I try and refer to the a name from another site:

<A href="http://www.mysite.com/page.html?5xp>clickHere</A> - It doesn't
refer to the aname, but always goes to the top of the page.

Change ?5xp of the link into #5xp.
Like this <a href="http://www.mysite.com/page.html#5xp">Jump to line xx of
xx page.</a>
 
T

Toby A Inkster

Miles said:
I have a webpage "foo.html, and have:
<a name="5xp">

What David said, but also the modern way of specifying fragments is to use
for example:

<h2 id="part2">Part 2</h2>

or

<table id="salesfigures">.....</table>

or

<p id="copyrightnotice">&copy; Me 2003.</p>

And then link to them like:

<a href="essay.html#part2">Part 2</a>

or

As you can see from our <a href="finances.html#salesfigures">huge
profits</a>, our company is a great investment...

or

Take a look at the <a href="about.html#copyrightnotice">fine print</a>.

This should work in all 5.x, 6.x and 7.x browsers, and even in Internet
Explorer 4.
 
S

Sid Ismail

On Wed, 22 Oct 2003 19:06:17 +0100, "Miles Davenport"

: <a name="5xp">
:
: In the html, if I click on a link on that page - it works fine.
:
: BUT, if I try and refer to the a name from another site:
:
: <A href="http://www.mysite.com/page.html?5xp>


What's the ? for ? Use the hash #.

Sid
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top