Who'd have thunk it?

| | Comments (0)

Reading the documentation actually does help!

I've been fighting with my "empty box" background image that I want to appear on all the pages of this blog. It was behaving "properly" in Internet Explorer, which usually means it's wrong. Netscape and Opera both were trying to center it across the entire window rather than just the right hand div, and Netscape was also scrolling it as I went up and down the screen rather than leaving it at the absolute bottom...which is where I said I wanted it to be.

On my third or fourth pass through the spec, I finally saw this stanza:
If the background image is fixed within the viewport (see the 'background-attachment' property), the image is placed relative to the viewport instead of the element's padding area.

Changing the attachment from "fixed" to "scroll" solved both the centering and scrolling problems at once. It's kind of counter-intuitive that fixed/bottom doesn't tack the image to the bottom, but that's the way it works. I'm just glad I finally stumbled across the answer.

Leave a comment

About this Entry

This page contains a single entry by Travis published on March 21, 2003 9:40 AM.

that was awesome was the previous entry in this blog.

Friday Five is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Powered by Movable Type 4.01