Going back to the top of the page

Discussion in 'HTML' started by Adrian, Jan 4, 2009.

  1. Adrian

    Adrian Guest

    In this code
    <a href="#1">Monday</a>
    some code....
    <a name = "1">Go fishing<a href ="#0">Back</a>

    How do I deal with the "back" to go to a new .html or to the top of the
    Is the code above ok?

    Adrian, Jan 4, 2009
    1. Advertisements

  2. Adrian

    Adrian Guest

    I have found out how it works. Many thanks.
    Adrian, Jan 4, 2009
    1. Advertisements

  3. Find. It's an illusion and the whole goal was pointless, but it's good that
    you can solve your problems outside this group (and don't wish to share your
    assumed solution with others that might have had the same problem).

    As usual, I urge you to use the same forged From information as long as you
    remain clueless. TIA.
    Jukka K. Korpela, Jan 4, 2009
  4. Adrian

    Jani Guest

    <a style="position: absolute; top: 0; left: 0;" id="top" name="top"></
    <a href="#top">top</a>

    .... so the 'style' attribute is not good behaviour?
    Better is an external style sheet?
    And what refers '#top' to? To the 'id' or to the 'name'?
    Jani, Jan 4, 2009
  5. Adrian

    dorayme Guest

    Usually, it is better to forget about the whole idea of providing
    facilities which your browser and keyboard already provide.
    dorayme, Jan 4, 2009
  6. I don't know of a browser that has a top-of-page button.
    Chris F.A. Johnson, Jan 5, 2009
  7. Adrian

    dorayme Guest

    All my browsers seem to conform to my words (which did not mention
    dorayme, Jan 5, 2009
  8. Does need one, just hit "home" on your keyboard.
    Jonathan N. Little, Jan 5, 2009
  9. Adrian

    rf Guest

    I don't know of one that does not. It's usually called the Home key, over
    there ---> under the 7 (on a PC anyway).
    rf, Jan 5, 2009
  10. And how do you use it with the mouse?

    The point of having a top-of-page button is for ease of use, so
    that the person using a mouse doesn't have to switch to the
    Chris F.A. Johnson, Jan 5, 2009
  11. Adrian

    rf Guest

    And how do you type in the URL of the page so as to view it in the first
    place *with* the mouse?
    IMHO it is far easier to bang on the home button than it is to find (and
    recognise in the first place) some random link and then manoeuvre to it with
    the mouse, given that I don't even have to actually look at the keyboard to
    find the home key.

    Are you going to provide an on-screen keyboard emulator so your person can
    use that to enter their login credentials?

    And how do you scroll down to start with? With the easy to use PgDn or [down
    arrow] keys or that pesky hard to use scroll bar (assuming you don't know
    how to use your mouse wheel)?

    Which brings up another matter, the scroll bar. If you *insist* on using the
    mouse then simply use it to lean on the blank bit above the scroller (not
    the arrow, the blank bit). In pretty short order you'll be at the top of the
    page, so browsers *do* have a built in to-the-top-of-the-page "button". To
    hurrry up matters hold down the Shift key while clicking on the top of the
    scroll bar. Oh, I forgot, no keyboard usage allowed :)
    rf, Jan 5, 2009
  12. How often do most people actually type in a URL?
    What's wrong with offering an alternative that may be faster?

    I realize that a top-of-page button is not necessary, but I don't
    understand the objections to it.
    Chris F.A. Johnson, Jan 5, 2009
  13. Adrian

    houghi Guest

    Indeed not so much a URL as people using Google as their URL bar. Even
    when I say "go to www.example.com" they type it not in the URL bar, but
    type google.com there (well, http://www.google.com) and then type
    www.example.com there. Weird.

    Just for this I think I will add perhaps google to robots.txt. >:-(

    houghi, Jan 5, 2009
  14. Jukka K. Korpela, Jan 5, 2009
  15. Adrian

    dorayme Guest

    In some circumstances, it is probably not too bad an idea. In general,
    it is best to keep to the simple and easy strategy of not duplicating
    browser and keyboard facilities, or we could say, not being in too much
    of a hurry to teach people how to use their browsers or keyboards.

    I have used back to top link in pages where there is an index at the top
    of a pretty long page to article summaries, each link going down to the
    summary. Here it is obvious that the user is likely to be going back and
    forth between index and summary. But am getting less inclined to do this
    even here (perhaps in part out of laziness).
    dorayme, Jan 5, 2009
  16. Adrian

    Jani Guest

    Wow Yucca! Now you teach me something new! I did not even know before
    that there exists a 'home' key!
    In times of notebooks I only want to add: 'FN' + 'F11' activates the
    small keyboard. Maybe you want to use it for
    the ASCII sequences: e.g.: 'alt' + 55 is '7'
    Jani, Jan 5, 2009
  17. I agree with you - this is why we can easely navigate on my page using
    only the mouse ...
    Raymond Schmit, Jan 5, 2009
  18. click and hold the empty part of the vertical scroll bar just below the
    '^' arrow button...
    Jonathan N. Little, Jan 6, 2009
  19. Adrian

    Adrian Guest

    Find. It's an illusion and the whole goal was pointless, but it's good
    Since you asked in such a pleasant way :)

    This was the solution to the problem I had which you
    might have taken to be a different problem to the
    one I attempted to describe.

    <body .....>
    <a name = "0"></a>

    some code

    <a href="#1">......heading.....</a>,&nbsp
    <a href="#2">......heading.....</a>,&nbsp
    <a href="#3">......heading.....</a>,&nbsp
    <a href="#4">......heading.....</a>,&nbsp

    some code

    <b><a name="1">......text ...... <ahref="#0">Home</a>
    <b><a name="2">......text ...... <ahref="#0">Home</a>
    <b><a name="3">......text ...... <ahref="#0">Home</a>
    <b><a name="4">......text ...... <ahref="#0">Home</a>

    some code


    Adrian, Jan 6, 2009
  20. While you *can* use an empty A element for an anchor, that is just
    soooooo last millennium! Use an ID attribute and forego the superfluous
    empty element.

    Now I keep seeing this thought the thread, you cannot have a digit for
    the leading character for an anchor identifier:

    Basic HTML data types

    So you could have it a "anchor0" or "top" may be simpler. Now to dump
    the empty A element... Simply do this:

    <body id="top">
    To the <a href=#top">top</a> of the page because I cannot find the
    "home" key!
    Jonathan N. Little, Jan 6, 2009
    1. Advertisements

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.