Link and Anchor

Discussion in 'HTML' started by Tim W, Feb 14, 2012.

  1. Tim W

    Tim W Guest

    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
    Tim W, Feb 14, 2012
    #1
    1. Advertising

  2. 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
    Beauregard T. Shagnasty, Feb 14, 2012
    #2
    1. Advertising

  3. In article <jhdpdk$8ho$>, 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>
    David Postill, Feb 14, 2012
    #3
  4. 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/
    Jukka K. Korpela, Feb 14, 2012
    #4
  5. 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
    Jonathan N. Little, Feb 14, 2012
    #5
  6. 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
    Beauregard T. Shagnasty, Feb 14, 2012
    #6
  7. Tim W

    Tim W Guest

    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
    Tim W, Feb 14, 2012
    #7
  8. Tim W

    dorayme Guest

    In article <jhdu5t$ukn$>,
    "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.

    --
    dorayme
    dorayme, Feb 14, 2012
    #8
  9. 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
    Beauregard T. Shagnasty, Feb 14, 2012
    #9
  10. 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
    Beauregard T. Shagnasty, Feb 14, 2012
    #10
  11. On Wed, 15 Feb 2012 06:58:08 +1100, dorayme <>
    wrote:

    >In article <jhdu5t$ukn$>,
    > "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.
    >
    >--
    >dorayme


    I have some bad news about your pseud.

    Sincerely,

    Gene Wirchenko
    Gene Wirchenko, Feb 14, 2012
    #11
  12. On Feb 14, 2:00 pm, 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?
    >
    > 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
    Michael Yardley, Feb 24, 2012
    #12
  13. Alan_Smith wrote:
    > 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.


    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
    Jonathan N. Little, Feb 24, 2012
    #13
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Spencer

    Re: Link Link Link DANGER WILL ROBINSON!!!

    Kevin Spencer, May 17, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    818
    Kevin Spencer
    May 17, 2005
  2. Paul Furman

    alt tag for an anchor link?

    Paul Furman, Feb 12, 2004, in forum: HTML
    Replies:
    13
    Views:
    43,676
    JohnNotion
    Apr 13, 2012
  3. Maxime
    Replies:
    7
    Views:
    3,300
    Jukka K. Korpela
    Mar 20, 2007
  4. David C
    Replies:
    2
    Views:
    806
    Damon B.
    Aug 31, 2008
  5. Ton den Hartog

    Link and Anchor, what is the difference ???

    Ton den Hartog, Jan 12, 2004, in forum: Javascript
    Replies:
    2
    Views:
    200
    Ton den Hartog
    Jan 12, 2004
Loading...

Share This Page