CSS Positioning Right
Positioning objects with CSS is pretty easy on a basic level. Using the background-position property you can set the value to "top left" and the image will sit in the top left corner of the element and stick there. By applying sufficient margin / padding to the objects inside the element, you can create space around the image creating the effect of an <img> tag where text flows around the image no matter what size the window is. Obviously then, it's much easier to let text flow across the image, a trick you can't do with an image tag. It's also why these images are referred to as background images, they're literally in the background and it takes some work with margins and padding to make them "appear" to be in the foreground.
So the next step obviously is that you'd like the option to stick something in the "top right" corner of an element. Well, that causes problems already, and it will come as no surprise that the culprit is Internet Explorer 6. In IE7, Opera, Safari, and Firefox, the "top right" value has almost the same behavior as "top left". There is a minor difference. When the browser becomes too narrow and the CSS for the page starts to break down, they break in different ways. "Top left" background images fall to the far left and elements with margin / padding to clear the image hit that boundary like a wall. The elements begin to stack up, effectively creating a minimum width and force the browser to create a scrollbar to view the entire width of the page. This behavior is seen in all browsers (IE, FF, & O).
"Top right" background images when the browser becomes narrow will violate the margin / padding and rather than create a minimum width, begin to share space with the element passing either over or under it.
Nevertheless, the results of "top right" conform to what you would expect in less extreme widths in most browsers (IE7, FF, S, & O). For the most part then, top right is quite usable.
If you take IE6 on the other hand, the situation is very different. The "top right" will only collapse as far as the largest child element will permit, and the image gets stuck at the right edge of this element. Note how the right edge of the test image and the right edge of the table are lined up in the full size example and this never changes no matter how the browser is resized. Infuriatingly, it displays this behavior even though the child elements like the heading in the example DO adjust to the changing width of the browser. Ironically, this does mean that IE6 never overlaps, but that is cold comfort. If IE6's behavior will cause problems for you than you are stuck without "top right" as an option until IE6 dies the horrible death that one day awaits it.
Playing with potential solutions, I have a new appreciation for why virtually every layout in CSS Zen Garden is a fixed width layout. Fixed width content permits you to position background images by pixel and have them consistently wind up where you want them. Fluid layouts do not give you the same flexibility even though they're more adapative cross-browser. This allows more complex design schemes with fixed width layouts given these limitations in CSS.
Another interesting issue with background images is that if you put them in a container, they must be inside it to be visible. I've tried several different scenarios, where I tried to push background images a bit, but if the container div is too small or if part of the image is pushed outside the boundary, then that part vanishes.
Despite a couple articles I read to the contrary, when I applied a position absolute to a child div, it blew outside it's parent div. Oops. I was hoping to solve the IE6 position:right issue by placing those images in CSS Zen Garden style divs. However, since the website layout is fluid, I can't assign the vertical position for it in the same way. I tried putting one of the extraDiv elements as a child div inside the section I wanted. However, when I assigned background-position:top right, instead of going to the top right corner of it's parent div it whooshed all the way to the top right corner of the webpage. Frustrating. Sometimes CSS seems tremendously convoluted. I wonder if I will ever feel like a master.
Skip to Main Points