Le 19 juil. 2013 à 09:07, John Snippe <[email protected]> a écrit :
> You'll notice that the src has size attributes. They are over-ridden by the
> CSS, it appears. I didn't know that would happen ;)
That is expected :-).
But you better leave out the width/height attributes, or, override _both_ of
them in the stylesheet. Otherwise when scaled the height of the image will
remains locked to what is specified in the attribute (the image is then
distorted).
so:
img { width: 90%; height: auto; }
As for the original requirement (the caption won't be wider than the intrinsic
width of the image), I don't think there is a css property (current or future)
that will do that. Perhaps some of the ideas being discussed in
http://dev.w3.org/csswg/css-images-3/#sizing
might help. You'd still need to define a width/max-width on the parent
container I suspect. And no browser support it currently.
Philippe
--
Philippe Wittenbergh
http://l-c-n.com
______________________________________________________________________
css-discuss [[email protected]]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/