Geeky web tip - 1 pixel shift of background image

Recently while coding a client’s site, I had an issue with a background image being misaligned by just one pixel. It was only happening in Safari. I tried a number of things and finally resorted to a CSS hack for Safari.

Today I found the shift also happened in Firefox 3. Doh!

Fortunately a discussion of rounding errors in Firefox got me to wondering about the size of the background image. Well, it was an odd number of pixels wide. Increasing the width of the image by one pixel fixed the bug in both FF3 and Safari. Bye-bye hack! Dunno why I didn’t think to check that before.

Write a comment





Previous post: « Wisdom of crowds
Next post: Gmail Tweaks »

Recently Written:

Categories

RSSSubscribe to RSS Feed

About

Tzaddi Gordon
link to linked in profile

Zodomatica is the personal site of Tzaddi Gordon, a web designer from Roberts Creek, BC, Canada. I'm passionate about design that balances form and function. I design, code, and hack other people's scripts. Lately I groove on WordPress as a CMS.
My portfolio