Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > Links don't work !

Reply
Thread Tools

Links don't work !

 
 
Thibault
Guest
Posts: n/a
 
      05-10-2004

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/


 
Reply With Quote
 
 
 
 
SpaceGirl
Guest
Posts: n/a
 
      05-10-2004

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


 
Reply With Quote
 
 
 
 
Steve Pugh
Guest
Posts: n/a
 
      05-10-2004
"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/>
 
Reply With Quote
 
Thibault
Guest
Posts: n/a
 
      05-10-2004

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


 
Reply With Quote
 
SpaceGirl
Guest
Posts: n/a
 
      05-10-2004

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


 
Reply With Quote
 
Thibault
Guest
Posts: n/a
 
      05-10-2004

"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


 
Reply With Quote
 
SpaceGirl
Guest
Posts: n/a
 
      05-10-2004

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


 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      05-10-2004
"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


 
Reply With Quote
 
Steve Pugh
Guest
Posts: n/a
 
      05-10-2004
"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/>
 
Reply With Quote
 
Jeff Thies
Guest
Posts: n/a
 
      05-10-2004

"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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Update to FAQ - Relative URLs for In-page Links and Links to Notes Garrett Smith Javascript 14 05-26-2009 04:50 PM
FF Crashes on Links within Links Puma Firefox 10 02-17-2009 07:12 PM
Make A Shorter Link - no new links accepted, old links still work. why? Computer Support 7 01-02-2007 09:45 PM
Site Links and Physical WAN Links =?Utf-8?B?RW5mb1BhdWw=?= MCSE 2 03-22-2005 09:23 AM
Exchange Links < Western Cartoon Cards > Exchange Links www.westerncartooncards.ca HTML 2 07-12-2004 07:59 PM



Advertisments