Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Link and Anchor

Reply
Thread Tools

Link and Anchor

 
 
Tim W
Guest
Posts: n/a
 
      02-14-2012
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
 
Reply With Quote
 
 
 
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      02-14-2012
Tim W wrote:

> 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.

--
-bts
-This space for rent, but the price is high
 
Reply With Quote
 
 
 
 
David Postill
Guest
Posts: n/a
 
      02-14-2012
In article <jhdpdk$8ho$(E-Mail Removed)>, on Tue, 14 Feb 2012 14:00:22
+0000, Tim W wrote:

| 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
--
David Postill
Dance your Life - Biodanza in Holland - <http://www.danceyourlife.eu>
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      02-14-2012
2012-02-14 16:00, Tim W wrote:

> 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>

--
Yucca, http://www.cs.tut.fi/~jkorpela/
 
Reply With Quote
 
Jonathan N. Little
Guest
Posts: n/a
 
      02-14-2012
Tim W wrote:
> 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...


--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      02-14-2012
Beauregard T. Shagnasty replied to hisself:

> at the end.</aP


Typo: should have been </p>

--
-bts
-This space for rent, but the price is high
 
Reply With Quote
 
Tim W
Guest
Posts: n/a
 
      02-14-2012
On 14/02/2012 14:45, Jonathan N. Little wrote:
> Tim W wrote:
>> 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...
>


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

Tim w

 
Reply With Quote
 
dorayme
Guest
Posts: n/a
 
      02-14-2012
In article <jhdu5t$ukn$(E-Mail Removed)>,
"Beauregard T. Shagnasty" <(E-Mail Removed)> wrote:

> Beauregard T. Shagnasty replied to hisself:
>
> > at the end.</aP

>
> 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.

--
dorayme
 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      02-14-2012
Hot-Text wrote:

> Beauregard T. Shagnasty wrote:
>> Beauregard T. Shagnasty replied to hisself:
>>> at the end.</aP

>>
>> Typo: should have been </p>

>
> 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.

--
-bts
-This space for rent, but the price is high
 
Reply With Quote
 
Beauregard T. Shagnasty
Guest
Posts: n/a
 
      02-14-2012
dorayme wrote:

> Beauregard T. Shagnasty wrote:
>> Beauregard T. Shagnasty replied to hisself:
>>> at the end.</aP

>>
>> 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.


<LOL>

--
-bts
-This space for rent, but the price is high
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
alt tag for an anchor link? Paul Furman HTML 13 04-13-2012 01:53 PM
Link Button control and anchor within page do not work in Mobile 6.0 David C ASP .Net Mobile 2 08-31-2008 12:23 AM
CSS A (link-anchor) syntax question still just me HTML 8 05-08-2008 01:38 AM
Link, name, parameter and anchor Maxime HTML 7 03-20-2007 03:11 PM
Link and Anchor, what is the difference ??? Ton den Hartog Javascript 2 01-12-2004 09:00 PM



Advertisments