Link Code

Discussion in 'HTML' started by Nowhere, Jul 19, 2005.

  1. Nowhere

    Nowhere Guest

    What is the code for a link to a specific part of another page? Thanks.
     
    Nowhere, Jul 19, 2005
    #1
    1. Advertisements

  2. Nowhere

    Steve Pugh Guest

    Nowhere wrote:
    > What is the code for a link to a specific part of another page? Thanks.


    The link:
    <a href="otherpage.html#foo">link text</a>

    The other page:
    <a name="foo">anchor</a>
    or
    <h1 id="foo">heading</h1>

    name is supported by all browsers, id si supported by all modern
    browsers (even IE). You don't need to use <h1>, almost any element can
    take an id.

    If the other page is not under control and if there are no names or ids
    already in it then you can't link to specific regions.

    Steve
     
    Steve Pugh, Jul 19, 2005
    #2
    1. Advertisements

  3. Nowhere

    Spartanicus Guest

    "Nowhere" <> wrote:

    >What is the code for a link to a specific part of another page?


    <a href="foo.htm#bar">bar</a>

    In foo.htm: <h2 id="bar">bar</h2>

    --
    Spartanicus
     
    Spartanicus, Jul 19, 2005
    #3
    1. Advertisements

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. Graham Thomson
    Replies:
    3
    Views:
    647
    Eki Y. Baskoro
    Dec 18, 2003
  2. J.Artieda

    link c code with c++ code using g++

    J.Artieda, Apr 9, 2004, in forum: C Programming
    Replies:
    1
    Views:
    531
  3. Dan M
    Replies:
    5
    Views:
    655
  4. kolesdz
    Replies:
    9
    Views:
    782
    Blinky the Shark
    Aug 22, 2007
  5. Marina Limeira

    LINK with another link

    Marina Limeira, Feb 7, 2006, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    256
    Marina Limeira
    Feb 7, 2006
  6. Andrew
    Replies:
    2
    Views:
    212
    Andrew
    Feb 18, 2009
  7. Blue®
    Replies:
    4
    Views:
    1,228
    Blue®
    Sep 27, 2003
  8. Carl Gilbert

    Link to run script and link to page

    Carl Gilbert, Jan 13, 2004, in forum: Javascript
    Replies:
    3
    Views:
    295
    Michael Winter
    Jan 13, 2004
Loading...