This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 19155 - Great Idea - CSS3 element(), image() and image-set() functions for "content" property
Summary: Great Idea - CSS3 element(), image() and image-set() functions for "content" ...
Status: RESOLVED WORKSFORME
Alias: None
Product: CSS
Classification: Unclassified
Component: Image Values and Replaced Content (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: Tab Atkins Jr.
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-01 01:43 UTC by Alexei03a
Modified: 2012-10-01 16:56 UTC (History)
2 users (show)

See Also:


Attachments

Description Alexei03a 2012-10-01 01:43:42 UTC
Using the CSS3 image () in the content can greatly enhance the ability of developers.

- Using fallbacks (if image does not support, then display next).
- Display, for example, first frame of GIF image.
- Fill element by solid color, if have width and height attribute.
- NOT JavaScript, pure CSS3.
- Images by CSS, not only HTML5.
- Visual custom elements (display canvas instead img, but this element is img).

Examples:

#img {
    content: image('cat_meme.gif#frame=5', 'lolcat.png');
}
Display 5'th frame of GIF image. Visual element is static.

#img:after {
    content: image('cat_meme.gif#frame=5', 'lolcat.png');
}
Insert to container 5'th frame of GIF image after content.

#img {
    content: element(#canvas);
}
Conversion simple image element to interactive canvas element. Size must correct working, like image element.

#img:after {
    content: element(#canvas);
}
Insert canvas element to after of content in container.
Comment 1 Tab Atkins Jr. 2012-10-01 16:56:12 UTC
The examples you provide already work per spec.