
Originally Posted by
ralph.m
The second link you posted looks pretty good, especially as it seems to account for transparent images (though I can't quite work out how just yet!). I'd not seen that one before, so would be interested in what other CSS experts think of it, such as @
Paul O'B ("other" than the author, that is!).
It's very similar to the CSS quiz we had a few years ago where an image was used in the html to push the text out of the way. The image can be supplied via the content property for modern browsers as mentioned in the quiz and saves any extra mark up. If the image is missing then the text just slides back into view.
It's a good technique and will work with transparent images. A few years ago it wasn't worth the extra effort as support was limited but these days it is probably a worthwhile alternative.
Edit:
I didn't mention the downside in that you get the broken image icon in chrome and webkit should the image be missing. I've put up a demo here which solves that problem although the image has to be doctored to make it work.
Bookmarks