Misaligned fragment URLs

Monday 24 January 2005

If you find yourself following URLs that have fragment identifiers (you know, the part after the "#" hash mark), and they take you to the right page, but not the right place on the page, then most likely the page you've landed on has images without width and height attributes. The browser loads the page, and finds the spot identified by the fragment id, but then the images load in, and move the page around underneath you.

The fix is to make sure all of the images on the page have width and height attributes. That way the page is laid out correctly even before the images are loaded, and the fragments will work properly.

As you may have already guessed, I updated my blog software to add width and height attributes to all my images. Using Python Imaging Library, it was a piece of cake. Links to particular blog entries on this site will now work much better.

Comments

[gravatar]
Nancy Bea Miller 4:57 PM on 24 Jan 2005

Interesting. My brother (http://www.glikglik.com/) told me the same thing about the same problem I was having on my blog. But now I just add the height and width manually when posting.

Add a comment:

name
email
Ignore this:
not displayed and no spam.
Leave this empty:
www
not searched.
 
Name and either email or www are required.
Don't put anything here:
Leave this empty:
URLs auto-link and some tags are allowed: <a><b><i><p><br><pre>.