W3C home > Mailing lists > Public > www-svg@w3.org > August 2010

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

From: Jeff Schiller <codedread@gmail.com>
Date: Sat, 21 Aug 2010 12:16:52 -0700
Message-ID: <AANLkTin_E8cUmRRWb_Zthc6pOasVF_i9_NEbH5oJKqHL@mail.gmail.com>
To: Tony Schreiner <tonyschr@microsoft.com>
Cc: Kevin Ar18 <kevinar18@hotmail.com>, "www-svg@w3.org" <www-svg@w3.org>
On Thu, Aug 19, 2010 at 3:08 PM, Tony Schreiner <tonyschr@microsoft.com>wrote:

>
>
The list of CSS properties Jeff referenced are the ones that apply to the
> SVG content itself, but I would argue that when the outermost SVG element is
> embedded in HTML it must behave on equal footing with similar HTML elements.
> Going even further, when embedded in HTML the outermost SVG element should
> also support being directly styled a block or inline block, positioned as
> absolute, relative, or fixed, and so on. None of these styles are in that
> list, and none of these make sense for the SVG content itself, but they do
> make sense on the root SVG container element in HTML.
>
>
>

I actually have no strong opinion one way or another here.  It's just been
my understanding that SVG elements can't be styled with border properties
(for instance).  It seemed a logical conclusion to draw since there is no
box model concept in SVG.  I didn't think about the CSS ramifications of the
fact that an <svg> inline in a HTML context does create a page-aligned box.

My main concern in this matter is the following:  Will it be more confusing
to new authors to say 'SVG elements cannot be styled with a CSS border' or
'SVG elements cannot be styled with a CSS border except for the outermost
<svg> element inline in a HTML context' ?

If the specs are updated for the latter and it's clear to authors in
practice and we don't get fifty emails to www-svg saying "Why can't I have a
CSS border around my <circle>?" then I'm fine either way.  I'll probably
still wrap my <svg>s in a <div> though ;)

Jeff
Received on Saturday, 21 August 2010 19:17:40 GMT

This archive was generated by hypermail 2.3.1 : Friday, 8 March 2013 15:54:45 GMT