• HI.
    How do I make a link on my webpage to a place on my webpage.

    For instance: Lets say I have diffrent Categorys sorted alfabetical.
    And the header is A, B, C, D, E.

    Webpage is like this:
    A(1):
    – Every category that stars with A is listed here.

    If I click A in the header I want the page to scroll down to A(1) And the mousepointer to be there.

    This is my code for A. <a href="" style="color:#FFF8DC" title="A">A</a>
    This is my code for A(1) <center> <strong><p style = "font-family:Helvetica; font-size:20px; text-decoration:none;title="A">A </a></center>

    How should they be?

    As I have understood I have to give them IDs but I don`t get it correct when I try.
    Thanks for helping!

Viewing 15 replies - 1 through 15 (of 15 total)
  • From my HTML knowledge, you’re talking about anchors.

    A basic anchor code is:
    <a href="#1">Click here to go to number one</a>

    So, if I’m correct, you would also need to wrap the “A” you’re linking to in an a href tag.

    Try:

    <a href="#A"><font color="#">A</font></a> {notice I split these two tags - you might not need to but it keeps it simple. This was you can troubleshoot if your tag stuffs up}
    
     <center> <strong><a><p style = "font-family:Helvetica; font-size:20px; text-decoration:none; >A </a></p></strong></center>

    Note there were a bunch of tags there you didn’t close before.

    I may be wrong, and I haven’t tested it, but from my understanding something like that should work.

    Thread Starter sunsi55

    (@sunsi55)

    Thanks for answer.
    Your code dosen`t work.

    Don`t i need to write #A somewhere in my A(1) tag to make the A find it?
    Give my A(1) a id that is = #A
    but how?

    Haha I fail, sorry I deleted a line from that code…

    it SHOULD be

    <center> <strong><a name="A"><p style = "font-family:Helvetica; font-size:20px; text-decoration:none; >A </a></p></strong></center>

    Sorry!

    Thread Starter sunsi55

    (@sunsi55)

    Can`t seem to get it to work…

    Hmmm. Problem might be with your styles here – try to implement a simplified version of the code first.

    Try this code where you want to create a link:
    <a href="#A">Link to A</a>

    And this code where you want to link to:
    <a name="A">This is A</a>

    Should work like this: Test Page Here

    Thread Starter sunsi55

    (@sunsi55)

    Okey. Now my code looks like this:
    A: <a href="#A" style="color:#FFF8DC" title="A">A</a>
    A(1) : <a><p style = "font-family:Helvetica; font-size:20px; text-decoration:none;title="A">A </a>

    Can you see where I have gone wrong?

    Edit!: I got it now!
    It works!
    Great help! Thanks! ??

    Yes.

    With A(1) you have <a> at the beginning. You just need to put <a name="A"> instead.

    Thread Starter sunsi55

    (@sunsi55)

    It`s all good now!Thanks alot!
    But one more thing!:
    When I link to A(1) it appears on the bottom of my page. Is it possible to make it appear on top or in the middle?

    No worries. To fix the next problem, I’m not quite sure what you mean so could you link me to your page? ??

    Thread Starter sunsi55

    (@sunsi55)

    Just like on the test page you posted.

    Your: “This is A” appears in the bottom of the site right?
    I would like that ” This is A” To appear on the top of the site instead of the bottom.
    Do you understand what I mean? ??

    Thread Starter sunsi55

    (@sunsi55)

    I do now, thanks.

    All I have done on that website was to insert linebreaks using the code <br> so that you could see that the link “jumps” down the page to the target.

    You can position it anywhere on your page that you want to, just remove the <br> tags if you have copied them onto your website, if not you don’t need to remove them. You can position the “link” like you would any normal text on your site.

    Thread Starter sunsi55

    (@sunsi55)

    Okey. I see.
    I did have some
    tags myself!
    I`ll guess it all works fine when I remove them! ?? Thanks for the help!

    No worries, let me know if you need any more help with this

    Thread Starter sunsi55

    (@sunsi55)

    Will do!
    Thanks! ??

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘Link to a place on my website!’ is closed to new replies.