Why does named anchor fail?

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

The link looks like this:


The target looks like this:

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

The link resides on this page:


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?

Re: Why does named anchor fail?

Deciding to do something for the good of humanity, jim039845

Quoted text here. Click to load it

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:

Re: Why does named anchor fail?

Quoted text here. Click to load it

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

The solution was to add dimensions for every image on the page - even spacer
images - like so: <img
width="1" height="10" alt="">

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

Quoted text here. Click to load it

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

Re: Why does named anchor fail?

jim039845 wrote:

Quoted text here. Click to load it

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

Re: Why does named anchor fail?

jim039845 wrote:
Quoted text here. Click to load it

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

Rik Wasmus

Re: Why does named anchor fail?

Gazing into my crystal ball I observed "jim039845"

Quoted text here. Click to load it

You really shouldn't be using spacer images.  There are much more cleaner
methods.  Use tables for tabular data only, and position elements with
CSS, not tables and spacer images.  You will be happier as a developer,
search engine bots will have less to sift through, and your visitors will
be happy because there will be less download time with a more accessible

Adrienne Boswell at Home
Arbpen Web Site Design Services
Please respond to the group so others can share

Re: Why does named anchor fail?

Quoted text here. Click to load it

Blank, with Javascript unavailable.

img tag not closed:

        <img src="http://www.postpositive.org/images/illuminati4.gif"
        width="367" height="400" alt="">

You have several links wit the text "Read the rest of this entry", each
to different targets, and no unique, distinguishing title attribute.

Andy Mabbett
                Say "NO!" to compulsory ID Cards:  <http://www.no2id.net/

                Free Our Data:  <http://www.freeourdata.org.uk

Site Timeline