Links don't work !

Discussion in 'HTML' started by Thibault, May 10, 2004.

  1. Thibault

    Thibault Guest

    Hey,

    Ok so I finally succeed in creating a geographical map with points on it,
    whom coordinates come from a MySql database (I used PHP). There is a last
    thing I don't understand : in the html page that is displayed, only some of
    the links I made on my points work, the other don't. Here is the beginning
    of the file, for you to understand (in fact there is 62 points, but it is
    always the same thing) :

    <HTML>

    <HEAD>
    <STYLE TYPE="text/css">
    .pixel1 {
    position:absolute;
    padding-left:100;
    padding-top:100;
    }
    .pixel2 {
    position:absolute;
    padding-left:150;
    padding-top:200;
    }
    </STYLE>
    </HEAD>

    <BODY>
    <TABLE>
    <TR>
    <TD valign="top">
    <span class="pixel1"><A href="sable.php?id=1" TITLE="Awbari"><img
    src="point.gif"></A></span>
    <span class="pixel2"><A href="sable.php?id=2" TITLE="Frederikshavn"><img
    src="point.gif"></A></span>
    </TD>
    </TR>
    </TABLE>
    </BODY>
    </HTML>

    Now the question is : why in the hell the second hyperlink works and the
    first one don't !?
    Thanks for your help !

    Thibault
    --
    http://perso.wanadoo.fr/titan_keikomi/
     
    Thibault, May 10, 2004
    #1
    1. Advertising

  2. Thibault

    SpaceGirl Guest

    "Thibault" <> wrote in message
    news:c7o7ej$k7e$...
    >
    > Hey,
    >
    > Ok so I finally succeed in creating a geographical map with points on it,
    > whom coordinates come from a MySql database (I used PHP). There is a last
    > thing I don't understand : in the html page that is displayed, only some

    of
    > the links I made on my points work, the other don't. Here is the beginning
    > of the file, for you to understand (in fact there is 62 points, but it is
    > always the same thing) :
    >
    > <HTML>
    >
    > <HEAD>
    > <STYLE TYPE="text/css">
    > .pixel1 {
    > position:absolute;
    > padding-left:100;
    > padding-top:100;
    > }
    > .pixel2 {
    > position:absolute;
    > padding-left:150;
    > padding-top:200;
    > }
    > </STYLE>
    > </HEAD>
    >
    > <BODY>
    > <TABLE>
    > <TR>
    > <TD valign="top">
    > <span class="pixel1"><A href="sable.php?id=1" TITLE="Awbari"><img
    > src="point.gif"></A></span>
    > <span class="pixel2"><A href="sable.php?id=2" TITLE="Frederikshavn"><img
    > src="point.gif"></A></span>
    > </TD>
    > </TR>
    > </TABLE>
    > </BODY>
    > </HTML>
    >
    > Now the question is : why in the hell the second hyperlink works and the
    > first one don't !?
    > Thanks for your help !
    >
    > Thibault
    > --
    > http://perso.wanadoo.fr/titan_keikomi/



    Why all the uppercase tags? Anyway... no way of seeing why this isn't
    working without seeing your site.
     
    SpaceGirl, May 10, 2004
    #2
    1. Advertising

  3. Thibault

    Steve Pugh Guest

    "SpaceGirl" <> wrote:
    >"Thibault" <> wrote in message
    >news:c7o7ej$k7e$...
    >>
    >> Ok so I finally succeed in creating a geographical map with points on it,
    >> whom coordinates come from a MySql database (I used PHP). There is a last
    >> thing I don't understand : in the html page that is displayed, only some
    >> of the links I made on my points work, the other don't. Here is the
    >> beginning of the file, for you to understand (in fact there is 62 points,
    >> but it is always the same thing) :
    >>
    >> <HTML>
    >>
    >> <HEAD>
    >> <STYLE TYPE="text/css">
    >> .pixel1 {
    >> position:absolute;
    >> padding-left:100;
    >> padding-top:100;
    >> }


    If you're setting position to absolute then why aren't you setting any
    of left, right, top or bottom as well?

    Those padding values are wrong (all non-zero lengths must have units)
    and so will be ignored by some browsers.

    >> .pixel2 {
    >> position:absolute;
    >> padding-left:150;
    >> padding-top:200;
    >> }
    >> </STYLE>
    >> </HEAD>
    >>
    >> <BODY>
    >> <TABLE>


    What's the point of the table?

    >> <TR>
    >> <TD valign="top">
    >> <span class="pixel1"><A href="sable.php?id=1" TITLE="Awbari"><img
    >> src="point.gif"></A></span>


    You're missing the required alt attribute.

    >> <span class="pixel2"><A href="sable.php?id=2" TITLE="Frederikshavn"><img
    >> src="point.gif"></A></span>
    >> </TD>
    >> </TR>
    >> </TABLE>
    >> </BODY>
    >> </HTML>
    >>
    >> Now the question is : why in the hell the second hyperlink works and the
    >> first one don't !?


    They're both clickable for me in IE6 but behave as you describe in
    Opera 7.23 and Mozilla 1.6.

    Add some borders to pixel1 and pixel2 and you will see that pixel1 is
    completely contained within the boundaries of pixel2. As pixel2 comes
    later in the source code and as z-index as not been set this means
    that pixel1 is 'under' pixel2. Now, it turns out that pixel1 is under
    the padding of pixel2 and this is presumably what makes the first one
    clickable in IE.

    Changing padding-left to left and passing-top to top would solve the
    problem (assuming that the images are small enough not to overlap.
    This will also let you get rid of the spans and apply the styles to
    the anchors or images themselves.

    So you would end up with something like this:
    <HTML>
    <HEAD>
    <STYLE TYPE="text/css">
    .pixel1 {
    position:absolute;
    left:100px;
    top:100px;
    }
    .pixel2 {
    position:absolute;
    left:150px;
    top:200px;
    }
    </STYLE>
    </HEAD>
    <BODY>
    <A href="sable.php?id=1" TITLE="Awbari" class="pixel1"><img
    src="point.gif" ALT="Awbari"></A>
    <A href="sable.php?id=2" TITLE="Frederikshavn" class="pixel2"><img
    src="point.gif" ALT="Frederikshavn"></A>
    </BODY>
    </HTML>

    >Why all the uppercase tags?


    Maybe because it's easier to see at a glance what's HTML and what's
    content if the HTML is all uppercase? Certainly that is why I got into
    the habit of using uppercase tags back when I learnt HTML (long before
    I ever saw an editor that colour coded different parts of the code).
    It's equally valid either way so is entirely down to personal choice.

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, May 10, 2004
    #3
  4. Thibault

    Thibault Guest

    "SpaceGirl" a écrit dans le message news:
    > Why all the uppercase tags?


    Because tags are more legible in uppercase in Notetab.


    > Anyway... no way of seeing why this isn't working without seeing your

    site.

    Here it is ... http://perso.wanadoo.fr/titan_keikomi/test/carte.html
    It seems to work in Internet Explorer. But not in Opera nor in Mozilla. I
    suppose there is a bug in my code and IE tolerates it. What could it be ?
    Thanks ...
     
    Thibault, May 10, 2004
    #4
  5. Thibault

    SpaceGirl Guest


    > >Why all the uppercase tags?

    >
    > Maybe because it's easier to see at a glance what's HTML and what's
    > content if the HTML is all uppercase? Certainly that is why I got into
    > the habit of using uppercase tags back when I learnt HTML (long before
    > I ever saw an editor that colour coded different parts of the code).
    > It's equally valid either way so is entirely down to personal choice.
    >
    > Steve



    ....not if you write XHTML, XML or are a programmer... It's all case
    sensitive. Get out of the bad habit right away, and it'll save confusion
    when you try to do more complex things that involve scripting. Uppercase
    XHTML will not validate...
     
    SpaceGirl, May 10, 2004
    #5
  6. Thibault

    Thibault Guest

    "Steve Pugh" a écrit dans le message news:
    > If you're setting position to absolute then why aren't you setting any
    > of left, right, top or bottom as well?


    Why would I do that ? Top and left-padding are sufficient for the point to
    know where he is supposed to be.


    > Those padding values are wrong (all non-zero lengths must have units)
    > and so will be ignored by some browsers.


    Wow, I didn't know that. In facts, all paddings I defined up till now where
    equal to zero, so I didn't have any problem. Thank you.


    > What's the point of the table?


    In facts, I display a map in the background, so defining a table with
    absolute width and height allows one to see all the map. But I removed the
    map and a lot of things, to make the code more legible and more compact, and
    I forgot to remove the table.


    > You're missing the required alt attribute.


    I know, the reason is the same as above.


    > They're both clickable for me in IE6 but behave as you describe in
    > Opera 7.23 and Mozilla 1.6.


    Yes, you're right. In facts, I used only Opera to test this, but it's true
    that IE has no problem with this.


    > Changing padding-left to left and passing-top to top would solve the
    > problem (assuming that the images are small enough not to overlap.


    They are not some times, but my php file is made in such a way that it
    displays only one image if two or more are overlapping.


    > This will also let you get rid of the spans and apply the styles to
    > the anchors or images themselves.


    Yes, thank you very much, it is better that way.


    > Maybe because it's easier to see at a glance what's HTML and what's
    > content if the HTML is all uppercase? Certainly that is why I got into
    > the habit of using uppercase tags back when I learnt HTML (long before
    > I ever saw an editor that colour coded different parts of the code).
    > It's equally valid either way so is entirely down to personal choice.


    You're definitely right.
    Thank you very much for your help !

    Thibault
     
    Thibault, May 10, 2004
    #6
  7. Thibault

    SpaceGirl Guest

    "Thibault" <> wrote in message
    news:c7o9cn$bra$...
    >
    > "SpaceGirl" a écrit dans le message news:
    > > Why all the uppercase tags?

    >
    > Because tags are more legible in uppercase in Notetab.
    >


    Dont use Notetab then. Writing code (tags) in uppercase is bad habit to get
    into - soon as you start having to embed scripts or writer server side code
    you'll start getting tripped up. Also, XHTML (the 'next' version of HTML)
    does *not* validate in uppercase.

    >
    > > Anyway... no way of seeing why this isn't working without seeing your

    > site.
    >
    > Here it is ... http://perso.wanadoo.fr/titan_keikomi/test/carte.html
    > It seems to work in Internet Explorer. But not in Opera nor in Mozilla. I
    > suppose there is a bug in my code and IE tolerates it. What could it be ?
    > Thanks ...


    Looking...
     
    SpaceGirl, May 10, 2004
    #7
  8. "Thibault" <> wrote:

    > Here it is ... http://perso.wanadoo.fr/titan_keikomi/test/carte.html


    I see two red points with blue borders around them. I do not see the
    point. Showing a real life case might help in guessing what you really
    need - now we can only say that the current approach is wrong.

    > It seems to work in Internet Explorer. But not in Opera nor in
    > Mozilla. I suppose there is a bug in my code and IE tolerates it.
    > What could it be ?


    Of course there are errors in your code. Read Steve's reply. Note that
    stuff like padding-top:100; _must_ be ignored by a browser that conforms
    to CSS specifications. Whether fixing all the errors fixes the problem
    you have observed is not clear yet. The observed problem might relate to
    positioning the span elements at the same coordinates.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
     
    Jukka K. Korpela, May 10, 2004
    #8
  9. Thibault

    Steve Pugh Guest

    "SpaceGirl" <> wrote:
    >
    >> >Why all the uppercase tags?

    >>
    >> Maybe because it's easier to see at a glance what's HTML and what's
    >> content if the HTML is all uppercase? Certainly that is why I got into
    >> the habit of using uppercase tags back when I learnt HTML (long before
    >> I ever saw an editor that colour coded different parts of the code).
    >> It's equally valid either way so is entirely down to personal choice.

    >
    >...not if you write XHTML,


    Who said anything about writing XHTML? The OP's example was HTML
    (unclosed <img> elements) and XHTML offers nothing over HTML for the
    vast majority of authors and users.

    There are no benefts to writing XHTML for any of the projects I work
    on. I use XHTML for my personal home page and when a client requests
    it but for most sites HTML offers equal utility with fewer hassles.

    >XML or are a programmer...


    Irrelevant. Any decent XML tool or any decent program can output HTML
    in whatever case is requried by the user. Anything that can't is
    seriously flawed.

    >It's all case sensitive.


    Um, no it isn't. Some things are, some things aren't.

    >Get out of the bad habit right away, and it'll save confusion
    >when you try to do more complex things that involve scripting.


    Rubbish. I do lots of complex things with scripting and the case of
    the HTML makes no difference. Whilst some programming languages are
    themselves case sensitive that doesn't mean that any HTML they
    interface with has to be.

    >Uppercase XHTML will not validate...


    Really? Wow! I never knew that. I wonder how all the XHTML pages I've
    written over the past four years ever managed to validate?

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, May 10, 2004
    #9
  10. Thibault

    Jeff Thies Guest

    "Thibault" <> wrote in message
    news:c7oaev$8mf$...
    >
    > "Steve Pugh" a écrit dans le message news:
    > > If you're setting position to absolute then why aren't you setting any
    > > of left, right, top or bottom as well?

    >
    > Why would I do that ? Top and left-padding are sufficient for the point to
    > know where he is supposed to be.


    Hmmm,

    I looked at this and then read Steve's response and he had it spot on.

    The only reason the padding appears to work is that when you say position:
    absolute the browser is implying: top: 0px, left: 0px

    Forget the padding and the table., just set the position. And although I
    like to use lowercase tags, it's totally irrelevant to whether this works or
    not.

    Jeff
     
    Jeff Thies, May 10, 2004
    #10
  11. Thibault

    Mitja Guest

    Thibault <>
    (news:c7o7ej$k7e$) wrote:
    > Hey,
    >
    > Ok so I finally succeed in creating a geographical map with points on
    > it, whom coordinates come from a MySql database (I used PHP). There
    > is a last thing I don't understand : in the html page that is
    > displayed, only some of the links I made on my points work, the other
    > don't. Here is the beginning of the file, for you to understand (in
    > fact there is 62 points, but it is always the same thing) :
    >
    > <HTML>
    >
    > <HEAD>
    > <STYLE TYPE="text/css">
    > .pixel1 {
    > position:absolute;
    > padding-left:100;
    > padding-top:100;
    > }
    > .pixel2 {
    > position:absolute;
    > padding-left:150;
    > padding-top:200;
    > }
    > </STYLE>
    > </HEAD>
    >
    > <BODY>
    > <TABLE>
    > <TR>
    > <TD valign="top">
    > <span class="pixel1"><A href="sable.php?id=1" TITLE="Awbari"><img
    > src="point.gif"></A></span>
    > <span class="pixel2"><A href="sable.php?id=2"
    > TITLE="Frederikshavn"><img src="point.gif"></A></span>
    > </TD>
    > </TR>
    > </TABLE>
    > </BODY>
    > </HTML>
    >
    > Now the question is : why in the hell the second hyperlink works and
    > the first one don't !?
    > Thanks for your help !
    >
    > Thibault


    As others already mentioned, replacing "padding-top:100" with "top:100px"
    etc. solves the problem.

    I further suggest you don't complicate so much with separate css. In your
    case, ID selectors (#pixel1 and <img id="pixel1">) would seem more
    appropriate. Even better (and slightly easier to code in php, too) would be
    to use inline css:
    <div id="cities">
    <img src="..." style="top:100px;left:15px">
    <img ...>
    ...
    </div>
    And somewhere above it all simply
    <style> #cities img {position: absolute} </style>

    It's not better in any tangible way, it's just nicer :)
     
    Mitja, May 10, 2004
    #11
  12. Thibault

    SpaceGirl Guest

    "Steve Pugh" <> wrote in message
    news:...
    > "SpaceGirl" <> wrote:
    > >
    > >> >Why all the uppercase tags?
    > >>
    > >> Maybe because it's easier to see at a glance what's HTML and what's
    > >> content if the HTML is all uppercase? Certainly that is why I got into
    > >> the habit of using uppercase tags back when I learnt HTML (long before
    > >> I ever saw an editor that colour coded different parts of the code).
    > >> It's equally valid either way so is entirely down to personal choice.

    > >
    > >...not if you write XHTML,

    >
    > Who said anything about writing XHTML? The OP's example was HTML
    > (unclosed <img> elements) and XHTML offers nothing over HTML for the
    > vast majority of authors and users.


    He didn't... I was just pointing out it might not be a good habit to get
    into (from experience).

    > There are no benefts to writing XHTML for any of the projects I work
    > on. I use XHTML for my personal home page and when a client requests
    > it but for most sites HTML offers equal utility with fewer hassles.


    >
    > >XML or are a programmer...

    >
    > Irrelevant. Any decent XML tool or any decent program can output HTML
    > in whatever case is requried by the user. Anything that can't is
    > seriously flawed.
    >
    > >It's all case sensitive.

    >
    > Um, no it isn't. Some things are, some things aren't.
    >
    > >Get out of the bad habit right away, and it'll save confusion
    > >when you try to do more complex things that involve scripting.

    >
    > Rubbish. I do lots of complex things with scripting and the case of
    > the HTML makes no difference. Whilst some programming languages are
    > themselves case sensitive that doesn't mean that any HTML they
    > interface with has to be.


    That's what I thought, until we couldn't get a couple of sites to validate.
    We switch out headers and bulk to lowercase to see what would happen and
    suddenly both sites validate. It could have been coincidence I guess... Okay
    I just checked on W3C. XHTML *is* case sensitive. Write a simple page and
    use "<P>" in it. It wont validate. Replace that with "<p>". It does. I guess
    maybe W3C have it wrong?

    >
    > >Uppercase XHTML will not validate...

    >
    > Really? Wow! I never knew that. I wonder how all the XHTML pages I've
    > written over the past four years ever managed to validate?


    I have no idea. Maybe it doesn't? According to the W3C site... Gimme one of
    your URL and we can see for ourselves.


    > Steve
     
    SpaceGirl, May 10, 2004
    #12
  13. Thibault

    SpaceGirl Guest


    > I have no idea. Maybe it doesn't? According to the W3C site... Gimme one

    of
    > your URL and we can see for ourselves.
    >
    >
    > > Steve


    And I dont mean your homepage... I mean one of your websites that uses upper
    case XHTML...
     
    SpaceGirl, May 10, 2004
    #13
  14. While the city slept, SpaceGirl <> feverishly
    typed:

    [...]
    > Gimme one of your URL [...]


    All your URL are belong to us? ;-)

    Sorry, just couldn't resist...

    Cheers,
    Nige

    --
    Nigel Moss.

    Email address is not valid. . Take the dog out!
    http://www.nigenet.org.uk | Boycott E$$O!! http://www.stopesso.com
    In the land of the blind, the one-eyed man is very, very busy!
     
    nice.guy.nige, May 10, 2004
    #14
  15. Thibault

    Steve Pugh Guest

    "SpaceGirl" <> wrote:
    >"Steve Pugh" <> wrote in message
    >news:...
    >> "SpaceGirl" <> wrote:
    >> >
    >> >Get out of the bad habit right away, and it'll save confusion
    >> >when you try to do more complex things that involve scripting.

    >>
    >> Rubbish. I do lots of complex things with scripting and the case of
    >> the HTML makes no difference. Whilst some programming languages are
    >> themselves case sensitive that doesn't mean that any HTML they
    >> interface with has to be.

    >
    >That's what I thought, until we couldn't get a couple of sites to validate.


    What has validation got to do with "complex things that involve
    scripting". Did the complex scripting not work until the page
    validated?

    >We switch out headers and bulk to lowercase to see what would happen and
    >suddenly both sites validate.


    But did this solve your problem with "complex things that involve
    scripting"?

    > It could have been coincidence I guess... Okay
    >I just checked on W3C. XHTML *is* case sensitive.


    Yes I know. But what has that got to do with "complex things that
    involve scripting"?

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, May 11, 2004
    #15
  16. Thibault

    Steve Pugh Guest

    "SpaceGirl" <> wrote:

    >> I have no idea. Maybe it doesn't? According to the W3C site... Gimme one
    >> of your URL and we can see for ourselves.
    >>

    >And I dont mean your homepage... I mean one of your websites that uses upper
    >case XHTML...


    Sarcasm is a new thing to you isn't it?

    Steve

    --
    "My theories appal you, my heresies outrage you,
    I never answer letters and you don't like my tie." - The Doctor

    Steve Pugh <> <http://steve.pugh.net/>
     
    Steve Pugh, May 11, 2004
    #16
  17. Thibault

    SpaceGirl Guest

    "Steve Pugh" <> wrote in message
    news:p...
    > "SpaceGirl" <> wrote:
    > >"Steve Pugh" <> wrote in message
    > >news:...
    > >> "SpaceGirl" <> wrote:
    > >> >
    > >> >Get out of the bad habit right away, and it'll save confusion
    > >> >when you try to do more complex things that involve scripting.
    > >>
    > >> Rubbish. I do lots of complex things with scripting and the case of
    > >> the HTML makes no difference. Whilst some programming languages are
    > >> themselves case sensitive that doesn't mean that any HTML they
    > >> interface with has to be.

    > >
    > >That's what I thought, until we couldn't get a couple of sites to

    validate.
    >
    > What has validation got to do with "complex things that involve
    > scripting". Did the complex scripting not work until the page
    > validated?


    No, it didn't. But if you are switching between XHTML, C#, ASP and JS all
    day, it is a good idea to try use some sort of similar methodology across
    them all. That was all I was suggesting.

    >
    > >We switch out headers and bulk to lowercase to see what would happen and
    > >suddenly both sites validate.

    >
    > But did this solve your problem with "complex things that involve
    > scripting"?


    See above

    >
    > > It could have been coincidence I guess... Okay
    > >I just checked on W3C. XHTML *is* case sensitive.

    >
    > Yes I know. But what has that got to do with "complex things that
    > involve scripting"?
    >
    > Steve



    I did miss your sarcasm btw... late night posting... not good!
     
    SpaceGirl, May 11, 2004
    #17
  18. SpaceGirl wrote:
    > Writing code (tags) in uppercase is bad habit to getinto - soon as you
    > start having to embed scripts or writer server side code
    > you'll start getting tripped up.


    I'm yet to see how uppercase tags hurt server-side code. Would you mind
    giving an example?

    > Also, XHTML (the 'next' version of HTML) does *not* validate in uppercase.


    Python code isn't generally valid C++, but that's no reason to avoid
    Python. Why avoid certain HTML features just because they aren't valid
    in XHTML?
     
    Leif K-Brooks, May 11, 2004
    #18
  19. Thibault

    Neal Guest

    On Tue, 11 May 2004 20:04:25 GMT, Leif K-Brooks <>
    wrote:

    > Why avoid certain HTML features just because they aren't valid in XHTML?


    But capital letter tags aren't a feature of HTML, they're handy to be
    sure, but down the road you are going to have an easier time if you
    develop the habit of lower-casing your tags and attributes today.

    When the day comes that most browsers in use support XHTML when properly
    served, and you find benefit in changing your pages to XHTML, using
    lower-case, solidly semantic, valid and well-formed HTML 4.01 Strict
    markup today will pay off. Only minor cosmetic changes to the code will be
    needed.
     
    Neal, May 11, 2004
    #19
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DP
    Replies:
    0
    Views:
    1,184
  2. jalkadir
    Replies:
    2
    Views:
    405
  3. Replies:
    2
    Views:
    360
    Bernhard Sturm
    May 17, 2007
  4. Dot*Star
    Replies:
    1
    Views:
    1,447
  5. Sina Tootoonian
    Replies:
    0
    Views:
    83
    Sina Tootoonian
    Dec 9, 2003
Loading...

Share This Page