How to make a link to a page section/subheading

Discussion in 'HTML & Website Design' started by sherry_d, Nov 20, 2008.

  1. #1
    What i want to do is that when people get to my page, I want to be able to link them to a subheading rather than for them to see the whole stuff which maybe relavant. lets take this page for examble i want to find a way to link to the bottom where it says Brand Profile…
     
    sherry_d, Nov 20, 2008 IP
  2. bigroddy

    bigroddy Peon

    Messages:
    78
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You can do it using anchor <a> tags

    in your link add #nameofelement to the end
     
    bigroddy, Nov 20, 2008 IP
  3. bigroddy

    bigroddy Peon

    Messages:
    78
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    
    <a name="subheading">SubHeading</a>
    
    Code (markup):
    Then to link/direct there:

    
    <a href="page.html#subheading">Link</a>
    
    Code (markup):
    You can also forgo the anchor tag from the first part, and use an element id, but the anchor tag is the intended method.
     
    bigroddy, Nov 20, 2008 IP
  4. sherry_d

    sherry_d Peon

    Messages:
    76
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    bigrod

    thanks for that but I am not really getting what i need to do. can you be a bit clearer for more please on what to do?
     
    sherry_d, Nov 20, 2008 IP
  5. bigroddy

    bigroddy Peon

    Messages:
    78
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #5
    See the first bit of code...that's what you put around your subheading on the page you want to link to (but use proper name attribute and text for your subheading)

    The second part is how you link from whatever page you are linking from...with your page name instead of page.html and the name you used for your anchor tag after the #
     
    bigroddy, Nov 20, 2008 IP
  6. sherry_d

    sherry_d Peon

    Messages:
    76
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thank you so much. I got it and managed to do it:) with your instructions
     
    sherry_d, Nov 20, 2008 IP
  7. bigroddy

    bigroddy Peon

    Messages:
    78
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You're welcome
     
    bigroddy, Nov 20, 2008 IP