Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

html, is there something like #top to goto the bottom ?!?

Options
  • 18-05-2005 4:22pm
    #1
    Closed Accounts Posts: 2,464 ✭✭✭


    html, is there something like #top to goto the bottom ?!?

    looking for something like #bottom to stick on the end of a link is it possible ?


Comments

  • Closed Accounts Posts: 4,655 ✭✭✭Ph3n0m


    No, but you can do this:


    At the end of your page place this

    <a name="bottom"></a>


    and the refer to it like you would with #top


  • Closed Accounts Posts: 2,464 ✭✭✭Kristok


    thanks but that wouldnt work for me im looking to link to a page on another site and go straight to the bottom of it.


  • Closed Accounts Posts: 4,655 ✭✭✭Ph3n0m


    It would


    say you have the <a name="bottom"> on page 2


    you refer to it like <a href="page2.html#bottom">go</a>


  • Registered Users Posts: 15,443 ✭✭✭✭bonkey


    But if page2 is on someone else's site (as was said), then you can't put the <a name> in there. No?

    jc


  • Registered Users Posts: 1,481 ✭✭✭satchmo


    He means linking to the bottom of a page on a completely different site not controlled by him.

    No, I don't think there's any way to do this in html. Even using #top isn't valid html afaik, it's a hack that only works in Internet Explorer. However you could open the page in a new window and use javascript to scroll down to the bottom, that'd work.


  • Advertisement
  • Closed Accounts Posts: 2,464 ✭✭✭Kristok


    yea sorry not a site controlled by me.


  • Moderators, Politics Moderators Posts: 39,933 Mod ✭✭✭✭Seth Brundle


    From what I can see, a link to any objects name can be targetted. Just tested both a pic and table in both MSIE & FF and I was brought to them.
    Check the source code of your target page and see if any objects around where you want the link to go have a name attribute.
    Then just make the link <a href="http://www....../file.htm#object_name"&gt;


  • Registered Users Posts: 1,268 ✭✭✭hostyle


    kbannon wrote:
    From what I can see, a link to any objects name can be targetted. Just tested both a pic and table in both MSIE & FF and I was brought to them.

    I think you meant id, not name?


  • Registered Users Posts: 4,003 ✭✭✭rsynnott


    kbannon wrote:
    From what I can see, a link to any objects name can be targetted. Just tested both a pic and table in both MSIE & FF and I was brought to them.
    Check the source code of your target page and see if any objects around where you want the link to go have a name attribute.
    Then just make the link <a href="http://www....../file.htm#object_name"&gt;

    Yep, this should work, assuming the site you're targetting HAS object-ids. Dunno how standard it is, but seems to work in all major browsers.


  • Moderators, Politics Moderators Posts: 39,933 Mod ✭✭✭✭Seth Brundle


    @hostyle - id is not widely used so I went with name! Still gives same effect!


  • Advertisement
  • Closed Accounts Posts: 1,322 ✭✭✭phobos


    You could see if there are anchor tags on page2 already. View the source and see, it's worth a shot. Then you could just use them.

    ;-phobos-)


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    kbannon wrote:
    @hostyle - id is not widely used so I went with name! Still gives same effect!
    These days name is not widely used, so go with id.
    id is superior to name because:
    1. You can use it on any element.
    2. It can refer to the entire contents of a block element, <a> being an inline element doesn't offer that. Also you can have <a> elements inside that block element, whereas <a> does not allow for an <a> element inside it.
    3. It doesn't duplicate the name of an attribute with different semantics (name is used differently in <input> elements and a few others.
    4. It clarifies the semantics of <a> which now is used only for out-bound links.
    5. It has caused confusion as to what namespace the name is in (name attributes on <a> elements are in one namespace, that now used by id as well, but on form control elements are in a different namespace shared only by form control elements in that form).
    Because of this the use of name on <a> is no longer advisable. It's not officially deprecated, but you should pretty much consider it as such.


  • Moderators, Politics Moderators Posts: 39,933 Mod ✭✭✭✭Seth Brundle


    I am not as sure as you about id being more widely used. I guess it is on newer sites but on most older sites name is more common.
    Looking at the source code for this page the name attribute seems more common that id:-
    e.g. in one part of the page I see...
    id="threadrating_menu"
    name="goto_threadsearch"
    name="s"
    name="t"
    name="pp"
    name="page"

    In this instance the OP is better off looking at the code and searching for something with either a name or id attribute close to where they want to link to. However, as time goes on, id will become the norm


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    kbannon wrote:
    I am not as sure as you about id being more widely used. I guess it is on newer sites but on most older sites name is more common.
    Older sites have <center>, <blink> and <font> too.
    kbannon wrote:
    Looking at the source code for this page
    VBB is great in many ways, but good HTML is not one of them.


  • Moderators, Politics Moderators Posts: 39,933 Mod ✭✭✭✭Seth Brundle


    maybe so. Then VBB is similar to loads of sites (the majority?) out there which have poor HTML.


  • Closed Accounts Posts: 9,314 ✭✭✭Talliesin


    Surely one should aim to do it well though? :)


  • Moderators, Politics Moderators Posts: 39,933 Mod ✭✭✭✭Seth Brundle


    I agree but my point is that the OP can't control other peoples code and therefore will possibly have to link towards old HTML rather than newer attribures!


Advertisement