Results 1 to 18 of 18

Thread: html: anchor problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2002
    Location
    Finland, south area
    Posts
    29

    Unhappy html: anchor problem

    hello everyone
    i have a frameset with 2 frames: links.html and contents.html. there are several anchors in contents.html. so when the user choose some link i want contents.html to start from a spesific anchor according to that pressed link. that means i want contents.html to start further down on the page.

    i guess in links.html it should be something like this:

    <a href="contents.html#anchor-one" target="right">anchor-one</a>

    in contents.html i think it is:

    <br id="anchor-one"> or
    <a href="contents.html#anchor-one"></a> or <a name... etc.


    so do you have any idea how to do this and am i in a right direction with this?

    thank you in advance

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    <a href="contents.html#anchor-one" target="right">anchor-one</a>

    Correct.



    in contents.html it should be:

    <A name="anchor-one"></a>

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2002
    Location
    Finland, south area
    Posts
    29
    yes, thank you very much, now it works. i had tested that already, but i guess the problem was that that a-tag was outside the cell, because i'm using table. but it was much easier to solve this when i knew that the code was right. thanks

  4. #4
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    I think the ID thing should have worked also, don't know why it didn't. Maybe it was a browser bug.

  5. #5
    Addicted Member HairyDave's Avatar
    Join Date
    Aug 2002
    Location
    Er...I can't remember.
    Posts
    196
    Aren't "name" and "id" supposed to be the same thing? I thought XHTML brought in "id", but HTML uses "name" - so at the moment both are 'supposed' to work.

    I think this is right - so perhaps the use of "id" wasn't recognised. As Rick said, a browser bug...?

    HD

  6. #6
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    I think (from memory) ID must always be individual, but name can be the same for things like checkboxes, etc. But yeah ID is the way to go for XHTML.

  7. #7
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    XHTML is one mountain sized pain in the ass.

  8. #8
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    So if you want compatibility for both HTML 4 and XHTML 1 you'd do
    <a name="anchor-one" id="anchor-one"></a>

    XHTML is cool, might kick all those IE-only-because-of-poorly-written-code sites in the azz!
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  9. #9
    Black Cat JoshT's Avatar
    Join Date
    Nov 2000
    Location
    WNY, USA
    Posts
    4,032
    I'm switching to XHTML Strict for all my personal pages...
    Josh
    Get these: Mozilla Opera OpenBSD
    I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.

  10. #10
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Yeah it's not really that hard. I've been using strict for quite a while now, and I did have my site in XHTML 1.1, but the W3C scrapped the lang attribute in favour of the xml:lang attribute, but most browsers don't seem to suport that so I switched back to XHTML 1.0 strict for now.

  11. #11
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    What is the exact difference between Transitional and Strict?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  12. #12
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Mainly that transitional contains presentation markup rather than just content. Strict has only that, and relies on CSS to do the presentation. But if you use transitional you are supposed to write your page in strict, then add presentation tags to make your pages compatible with older browsers, if you need it that is

  13. #13
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    So <b>, <i>, <font> and such are not supported by strict?
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  14. #14
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    I think think <b> and <i> might be (although you should usually use <strong> and <em> as they work better in text-only browsers), but I'm pretty sure font isn't.

  15. #15
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I don't know anything about XHTML, but hasn't <font> been deprecated for awhile now?

    And where can I read up about XHTML and learn wise things?
    My evil laugh has a squeak in it.

    kristopherwilson.com

  16. #16
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    Originally posted by The Hobo
    I don't know anything about XHTML, but hasn't <font> been deprecated for awhile now?
    Yes, FONT tags have been depreciated in favor of using styles. Although most browsers will still support it.

    Originally posted by The Hobo
    And where can I read up about XHTML and learn wise things?
    Check out the Web Links at http://devnewt.ionichost.com I know there's one in there to a site about XHTML.
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  17. #17
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170
    Originally posted by The Hobo
    I don't know anything about XHTML, but hasn't <font> been deprecated for awhile now?

    And where can I read up about XHTML and learn wise things?
    The best place for online tutorials:

    http://www.w3schools.com/xhtml/

  18. #18
    Frenzied Member Rick Bull's Avatar
    Join Date
    Apr 2002
    Location
    England
    Posts
    1,444
    Or http://www.w3.org/TR/xhtml1/ if you don't mind reading some of the technical waffle

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width