Re: How does the svg element handle CSS border and background-color?

On 08/21/2010 02:39 PM, Doug Schepers wrote:
> Hi, folks-
> ...
> ==Conclusion==
> I propose we change SVG 2 to explicitly define this behavior. Hixie
> seems to imply that this is not for HTML to define, and I tend to agree
> with that, though maybe some informative mention in the HTML5 or CSS
> specs for how SVG treats margins and padding might be appropriate.
>
> I don't think this should be any different in standalone SVG files than
> in SVG files referenced or inlined in HTML. That would be very
> unintuitive, in my opinion.
>
> If this is not controversial, I would be happy to put any or all of this
> in the SVG Integration spec, which is one of the foundations of SVG 2
> [1]. If someone disagrees with this, we'll have to talk about it before
> I start editing the spec. In either case, it would need to be fleshed
> out some... I'm probably glossing over some possible stumbling blocks in
> the box model, which I'd appreciate feedback on.
>
> [1] http://dev.w3.org/SVG/modules/integration/SVGIntegration.html

I would just say that the <svg> element is considered a replaced
element as far as its surrounding contents are concerned, and any
CSS values set on it apply exactly as if applied to a replaced
element. And note that in some cases those values may also affect
the SVG, e.g. 'color' will inherit into the SVG content.

~fantasai

Received on Saturday, 21 August 2010 23:28:43 UTC