Misaligned fragment URLs

Monday 24 January 2005This is close to 20 years old. Be careful.

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]
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:

Ignore this:
Leave this empty:
Name is required. Either email or web are required. Email won't be displayed and I won't spam you. Your web site won't be indexed by search engines.
Don't put anything here:
Leave this empty:
Comment text is Markdown.