W3C home > Mailing lists > Public > www-style@w3.org > June 2009

Re: [css3-background] CSS Image Replacement

From: fantasai <fantasai.lists@inkedblade.net>
Date: Thu, 04 Jun 2009 08:22:28 -0700
Message-ID: <4A27E6B4.3050306@inkedblade.net>
To: Alexis Deveria <adeveria@gmail.com>
CC: www-style@w3.org
Alexis Deveria wrote:
> Any designers on this list are probably familiar with the concept of
> CSS image replacement. The use case is that people wish to replace
> text (often a logo or a header) with an image using CSS. There are a
> variety of ways to achieve this currently [1], but all have certain
> drawbacks that either hamper accessibility in some situations, or
> require additional markup.
> 
> Is anyone familiar with a solution to this problem that can be
> achieved through some CSS3 module? (most likely in Backgrounds and
> Borders [2]) Going through the current spec, I wasn't able to find
> one.

How about

#header {
   content: url(header.png), contents;
}

<h1 id="header">My Pretty Header</h1>

? This functionality is available in the CSS3 Generated and Replaced
Content module. <http://www.w3.org/TR/css3-content/#inserting3>

~fantasai
Received on Thursday, 4 June 2009 15:23:11 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:18 GMT