W3C home > Mailing lists > Public > www-style@w3.org > November 2011

[css3-content] sizing of images inserted using the content property

From: Florian Rivoal <florianr@opera.com>
Date: Mon, 21 Nov 2011 13:44:59 +0100
To: "www-style@w3.org" <www-style@w3.org>
Message-ID: <op.v5aq09qk4p7avi@localhost.localdomain>
Section "8. Replaced content" says that when the content introduced by  
content: is a single url, then the element or pseudo element is a replaced  

Given what the box model says about replaced elements, I understand it to  
mean that both of these should insert an image and size it to 42 x 42  

#foo {content: url("bar.jpg"); width : 42px; height:42px;}

#foo::before {content: url("bar.jpg"); width: 42px; height:42px;}

Chrome resizes the first one, but uses the intrinsic dimensions of the  
image for the second

firefox and ie don't support the first, and use intrinsic dimensions for  
the second

opera uses intrinsic dimensions for both cases

So we have interoperability but (obsolete) spec violation when replacing  
content on pseudo elements. For non-pseudos, Opera choses to be consistent  
with pseudos, while Chrome decides to follow the spec it just ignored.

Any idea about how to resolve this?
Received on Monday, 21 November 2011 12:45:28 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:07 UTC