Click here to get back home

Why does named anchor fail?

 HomeNewsGroups | Search | About
 comp.infosystems.www.authoring.html    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Why does named anchor fail? jim039845 08-08-2006
Posted by jim039845 on August 8, 2006, 8:44 pm
Please log in for more thread options


The link looks like this:

http://www.postpositive.net/library.php#cat6

The target looks like this:

<a name="cat6">cat6</a>

The link resides on this page:

http://www.postpositive.net/wp02/?cat=7

The FIRST time the link is clicked, you end up at the WRONG POSITION on the
page; SUBSEQUENT clicks will take you to the CORRECT POSITION (you can also
get to the correct position if you hit refresh after arriving on the new
page the first visit).

Browser cache needs to be cleared to repeat the error after the first visit.

I've tried adding 800px of margin-bottom and/or padding-bottom, and also
using transparent spacers on the bottom of the page, but no luck...

Is there some CSS trick to work around this problem?

The problem exists in both IE and FF

Other suggestions?



Posted by Mark Parnell on August 8, 2006, 8:53 pm
Please log in for more thread options


Deciding to do something for the good of humanity, jim039845

> The FIRST time the link is clicked, you end up at the WRONG POSITION on the
> page; SUBSEQUENT clicks will take you to the CORRECT POSITION (you can also
> get to the correct position if you hit refresh after arriving on the new
> page the first visit).

Adding the relevant dimensions of the images in the HTML would certainly
help - the problem is that the browser jumps to that point on the page
once the page itself loads, but then when the images load the page is
rearranged because it doesn't know in advance how much space to reserve
for the images.

IIRC there was a discussion about this only recently - I think it was
over in alt.html.

--
Mark Parnell
My Usenet is improved; yours could be too:
http://blinkynet.net/comp/uip5.html

Posted by jim039845 on August 8, 2006, 9:18 pm
Please log in for more thread options


> Adding the relevant dimensions of the images in the HTML would certainly
> help - the problem is that the browser jumps to that point on the page
> once the page itself loads, but then when the images load the page is
> rearranged because it doesn't know in advance how much space to reserve
> for the images.

Yes!! That was it!! Problem solved!!

The solution was to add dimensions for every image on the page - even spacer
images - like so: <img
src="http://www.postpositive.net/images/spacer-horizontal-10px.gif"
width="1" height="10" alt="">

Also, making sure the page validates against the W3C HTML validator is a
good idea....

> IIRC there was a discussion about this only recently - I think it was
> over in alt.html.

I guess misery loves company.

As far as I know, width and height dimensions are supposed to be "optional"
(according to the W3C spec). So much for optional...



Posted by Harlan Messinger on August 8, 2006, 11:00 pm
Please log in for more thread options


jim039845 wrote:

> As far as I know, width and height dimensions are supposed to be "optional"
> (according to the W3C spec). So much for optional...

Just because something's optional doesn't mean it doesn't make a difference!

Posted by Rik on August 9, 2006, 6:48 am
Please log in for more thread options


jim039845 wrote:
>> Adding the relevant dimensions of the images in the HTML would
>> certainly help - the problem is that the browser jumps to that point
>> on the page once the page itself loads, but then when the images
>> load the page is rearranged because it doesn't know in advance how
>> much space to reserve for the images.
>
> Yes!! That was it!! Problem solved!!
>
> The solution was to add dimensions for every image on the page - even
> spacer images - like so: <img
> src="http://www.postpositive.net/images/spacer-horizontal-10px.gif"
> width="1" height="10" alt="">
>
> Also, making sure the page validates against the W3C HTML validator
> is a good idea....
>
>> IIRC there was a discussion about this only recently - I think it was
>> over in alt.html.
>
> I guess misery loves company.
>
> As far as I know, width and height dimensions are supposed to be
> "optional" (according to the W3C spec). So much for optional...

Yup, but it's exactly their reason for existing. Not to resize images, for
which it's often abused, but to give the browser a hint how large the image
is before loading, so the page isn't rearranged on an image load. Not always
necessary, so optional, but in this case very welcome :-).

Grtz,
--
Rik Wasmus



Similar ThreadsPosted
Why does named anchor fail on first reference? July 6, 2006, 3:06 am
hyperlinks to jpeg image fail on new server December 2, 2007, 6:51 am
Named vs. numerical entities July 16, 2004, 1:47 am
Hiding an anchor tag September 1, 2006, 1:31 am
Anchor tags IE 7 February 25, 2007, 8:23 pm
In page anchor problem July 19, 2004, 8:00 am
FF: anchor links not working.. February 8, 2006, 10:52 am
html anchor tag displayed in middle not top October 11, 2005, 8:30 am
make area around anchor be clickable? April 22, 2005, 10:05 am
CSS styles not working for anchor tags. August 13, 2005, 4:03 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap