W3C home > Mailing lists > Public > whatwg@whatwg.org > August 2011

[whatwg] add html-attribute for "responsive images"

From: Karl Dubost <karld@opera.com>
Date: Wed, 31 Aug 2011 17:32:37 -0400
Message-ID: <3E8CD6FD-0A17-42C6-AAFD-BB93D6280777@opera.com>
(setting reply-to on www-style)

Seen this today, to remind people that it is not just 
something up in the air. People need it.

I wonder if it could be handled by CSS in fact. 
I guess Anselm, you could ask there.
On the www-style mailing-list, Charles proposed [1]

	content: url(img.jpg) replaced;

I'm not sure I fully understand the proposal 
but we can imagine something that could fit nicely 
with the CSS Generated Content Module Level 3 [2]

<img class="responsive" src="http://example.org/foo" alt="wiizz"/>

and then the CSS

@media  screen and (min-width:550px) and (max-width:960px) {
   img.responsive {
	url(http://example.org/foobis) replaced;}
@media  screen and (min-width:240px) and (max-width:549px) {
   img.responsive {
	url(http://example.org/footer) replaced;}

[1]: http://www.w3.org/mid/4E5D4A46.7000103 at jumis.com
[2]: http://dev.w3.org/csswg/css3-content/#replacedContent

Karl Dubost - http://dev.opera.com/
Developer Relations & Tools, Opera Software
Received on Wednesday, 31 August 2011 14:32:37 UTC

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