Re: [css3-background] CSS Image Replacement

On Jun 4, 2009, at 8:53 AM, Alexis Deveria wrote:

>> How about
>>
>> #header {
>>  content: url(header.png), contents;
>> }
>>
>> <h1 id="header">My Pretty Header</h1>
>
> Ah, didn't realize was possible, cool! That does indeed solve the use
> case in theory. However, without the positioning options the
> background-image property offers, this solution does not allow for
> sprites, which may be an issue for some authors. There may also be
> other benefits of using background-image, so ideally it would still be
> nice to be able to include them.

You can still use a separate image for :hover, etc., if using sprites  
is not a requirement.

It's also worth noting that with font embedding via @font-face, many  
of the needs to do CSS image replacement  go away, especially when you  
can combine that with text-shadow, RGBA colors (for translucency), etc.

Received on Thursday, 4 June 2009 17:22:46 UTC