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


    B(1):
    – Every Category that stars with B 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.
    If I click B in the header I want the page to scroll down to B(1) And the mousepointer to be there.

    How do I code this :)?

    Thanks for helping!

Viewing 6 replies - 1 through 6 (of 6 total)
  • You need named anchors..

    A named anchor example can be seen here.
    https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_link_bookmark

    If that’s not quite enough info, simply google/search for “named anchors”… (pretty straight-forward stuff).

    Thread Starter sunsi55

    (@sunsi55)

    Found some good links aswell.
    So I Figured it out! ??
    Thanks for helping!

    edit:
    too late – had this on my screen while doing other things ??

    make sure the html tag holding ‘A(1):’ has a unique css id, for instance <h3 id="#list-A">A(1):</h3>;

    for each list item in the header list, add a link pointing to this unique id, for instance <a href="#list-A">A</a>

    how to do this dynamically, depends on your existing code.

    Thread Starter sunsi55

    (@sunsi55)

    What do you mean by:

    ” How to do this dynamically, depends on your existing code”
    Isent it just to give my A(1) a id, and when clicking on A i link to the ID of A(1) ?

    Or have I missunderstood?

    Isent it just to give my A(1) a id, and when clicking on A i link to the ID of A(1) ?

    yes

    (i am not trying to confuse you.
    it depends on the way you want to do this;
    you can do it manually; – fine –
    or you could create the alphabetical list with the links to the anchors automatically, and also add the same anchors to the titles of the first letter of your category list automatically (dynamically);
    then the coding would depend on the existing code.)

    Thread Starter sunsi55

    (@sunsi55)

    Okey. Thanks. I`ll get back to my website creating on Monday.
    Think I got it ?? Atleast how I do it manualy.

    But Automatic I am not quite sure how I do it. Will that be alot faster?

    Thanks for helping!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Make a link to a place on the webpage’ is closed to new replies.