W3C home > Mailing lists > Public > whatwg@whatwg.org > November 2009

[whatwg] Adding a src attribute to all elements

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 3 Nov 2009 20:50:43 -0800
Message-ID: <dd0fbad0911032050l4c0fddd6r283f92a08a4b8e9b@mail.gmail.com>
On Tue, Nov 3, 2009 at 8:21 PM, Michael A. Puls II <shadow2531 at gmail.com> wrote:
> On Tue, 03 Nov 2009 21:05:26 -0500, Curtiss Grymala <curtiss at ten-321.com>
> wrote:
>> For instance, if I create a level 1 header that looks like:
>> <h1 src="/example.png">This is a header</h1>
>> The text "This is a header" would be replaced with the image that's
>> located at /example.png. However, if /example.png returns a 404 error,
>> the text would be displayed instead.
>
> Opera supports this with css extensions.

This is supported in the CSS specs properly, via the content property.

*[src] {
  content: attr(src,url);
}

Done.  (Doesn't work yet anywhere I believe, but it will.)

~TJ
Received on Tuesday, 3 November 2009 20:50:43 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:18 UTC