Link and Anchor

T

Tim W

What's the difference between a link and an anchor? Is there one?

My 'build your own website' manual that I have been learning from
doesn't make any distinction, the index says 'Anchor: see Link' but when
I look at the tinyMCE html editor it has separate buttons for inserting
a link and an anchor. The anchor button appears to put in a bit of html
like:
<a name="thenameyouchose"></a>
without the href bit. what would be the point of that?

Tim w
 
B

Beauregard T. Shagnasty

Tim said:
What's the difference between a link and an anchor? Is there one?

My 'build your own website' manual that I have been learning from
doesn't make any distinction, the index says 'Anchor: see Link' but when
I look at the tinyMCE html editor it has separate buttons for inserting
a link and an anchor. The anchor button appears to put in a bit of html
like:
<a name="thenameyouchose"></a>
without the href bit. what would be the point of that?

So you can send a click to a particular place on a page.

<p><a name="thenameyouchose"></a>This is a specific place on a page with
content you want to direct people to. It could be halfway down the page,
or even at the end.</aP

http://example.com/thispage.html#thenameyouchose

However, the modern way to do that is to use IDs.

<p id='thenameyouchose'>This is a specific place on a page with content
you want to direct people to. It could be halfway down the page, or even
at the end.</aP

Use relevant words for the anchors or IDs.
 
D

David Postill

| What's the difference between a link and an anchor? Is there one?
|
| My 'build your own website' manual that I have been learning from
| doesn't make any distinction, the index says 'Anchor: see Link' but when
| I look at the tinyMCE html editor it has separate buttons for inserting
| a link and an anchor. The anchor button appears to put in a bit of html
| like:
| <a name="thenameyouchose"></a>
| without the href bit. what would be the point of that?

http://www.hypergurl.com/anchors.html
 
J

Jukka K. Korpela

What's the difference between a link and an anchor? Is there one?

Typically, "anchor" refers to a potential destination of a link, a point
or an element that can be directly linked to.

Originally, "anchor" refers to both ends of a link, making the anchor
metaphor especially strange. But this usage explains the name of the <a>
and the use of that tag both for setting up a link and for setting up a
destination for a link.
My 'build your own website' manual that I have been learning from
doesn't make any distinction, the index says 'Anchor: see Link' but when
I look at the tinyMCE html editor it has separate buttons for inserting
a link and an anchor. The anchor button appears to put in a bit of html
like:
<a name="thenameyouchose"></a>
without the href bit. what would be the point of that?

That's the old way of setting up a destination anchor. The modern way is
to use the id attribute on any element you wish to link to, using e.g.

<h2 id=refs>Bibliography</h2>

instead of the clumsier

<h2><a name=refs>Bibliography</a></h2>
 
J

Jonathan N. Little

Tim said:
What's the difference between a link and an anchor? Is there one?

My 'build your own website' manual that I have been learning from
doesn't make any distinction, the index says 'Anchor: see Link' but when
I look at the tinyMCE html editor it has separate buttons for inserting
a link and an anchor. The anchor button appears to put in a bit of html
like:
<a name="thenameyouchose"></a>
without the href bit. what would be the point of that?

It becomes an "anchor" point *within* a page that you can "link" to.

Links <a href="http:/www/example.com/somepage">Some Page</a>

Not the above link is great to get you to the *top* of "somepage" but
say you want a link to got to a place of interest about half way done
the page? That is where an anchor comes in to play. In a URL the part is
called the URL *fragment* the it is place at the end after the hash "#"
character. So a link:

<a href="http:/www/example.com/somepage#seethis">See This on Some Page</a>

on somepage the code bit:

....
<!-- half way down add anchor -->
<a name="seethis"></a>

So the link would send the browser to somepage *and* scroll down to the
anchor "seethis" half way down page.

Now the legacy way using an A element with only an NAME attribute to
make anchor can be more efficiently accomplished by using an existing
element and adding an ID with the anchor name. So this would work too


<p id="seethis">The content that you want your link to go to...
 
T

Tim W

It becomes an "anchor" point *within* a page that you can "link" to.

Links <a href="http:/www/example.com/somepage">Some Page</a>

Not the above link is great to get you to the *top* of "somepage" but
say you want a link to got to a place of interest about half way done
the page? That is where an anchor comes in to play. In a URL the part
is called the URL *fragment* the it is place at the end after the hash
"#" character. So a link:

<a href="http:/www/example.com/somepage#seethis">See This on Some
Page</a>

on somepage the code bit:

...
<!-- half way down add anchor -->
<a name="seethis"></a>

So the link would send the browser to somepage *and* scroll down to
the anchor "seethis" half way down page.

Now the legacy way using an A element with only an NAME attribute to
make anchor can be more efficiently accomplished by using an existing
element and adding an ID with the anchor name. So this would work too


<p id="seethis">The content that you want your link to go to...

I get it now. thank you all. Useful for those gutenberg type texts with
thousands of words on a page I guess.

Tim w
 
D

dorayme

Beauregard T. Shagnasty said:
Beauregard T. Shagnasty replied to hisself:


Typo: should have been </p>

Damn, I went and changed all my books with permanent marker pen to end
paras how you said soon as I saw it. I will never trust you again.
 
B

Beauregard T. Shagnasty

Hot-Text said:
A Typo thank god it was not mine...... for truly Beauregard you would
seen it before I would....

I'm not sure I agree. It's hard to find typos in the stuff you post that
comes from your random word generator.
 
B

Beauregard T. Shagnasty

dorayme said:
Damn, I went and changed all my books with permanent marker pen to end
paras how you said soon as I saw it. I will never trust you again.

<LOL>
 
G

Gene Wirchenko

Damn, I went and changed all my books with permanent marker pen to end
paras how you said soon as I saw it. I will never trust you again.

I have some bad news about your pseud.

Sincerely,

Gene Wirchenko
 
M

Michael Yardley

What's the difference between a link and an anchor? Is there one?

My 'build your own website' manual that I have been learning from
doesn't make any distinction, the index says 'Anchor: see Link' but when
I look at the tinyMCE html editor it has separate buttons for inserting
a link and an anchor. The anchor button appears to put in a bit of html
like:
<a name="thenameyouchose"></a>
without the href bit. what would be the point of that?

Tim w

link

http://www.howtocreate.co.uk/tutorials/html/links

anchor

http://www.ehow.com/way_5249902_anchor-html-tutorial.html

What Is an Anchor Link?

http://www.ehow.com/info_8764729_anchor.html
 
J

Jonathan N. Little

Alan_Smith said:
The anchor is used to link different documents together. It contains at
least one attribute and for the function of linking to a different
document, the attribute HREF is used. The value of the attribute HREF is
the URL of the target document. And the link is a connection from one
Web resource to another. It has two ends anchors and a direction.
It is a little confusing what you are exactly saying here. It seems like
you are saying that a "link" is an A element with a closing tag and an
"anchor" is not. This is incorrect. An A element requires a closing tag
regardless:

<http://www.w3.org/TR/html401/struct/links.html#edef-A>

Also an A element does not require a HREF nor a NAME attribute.

I would say that an "anchor" and a "link" are roles that an A element
can provide using the HREF and NAME attributes. With an ID or NAME
attribute it can define an anchor point in a document, and with an HREF
is can define a link to another document or anchor point with the same
document.
 

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,999
Messages
2,570,243
Members
46,836
Latest member
login dogas

Latest Threads

Top