Reputation: 1369
As the title says: Why does external css doesnt work on svg elements in IE using D3.
Im using the D3 libary for creating rect
from a json file.
My json file can contain 100+ rect
with diffrent x and y cords.
To keep the json file small as possible i have a external css file with the width
, height
, fill
and stroke
.
It works in Chrome but not in IE and Firefox.
Here is a Fiddle example: Fiddle
Thanks in advance.
Upvotes: 0
Views: 297
Reputation: 124059
width and height are not CSS properties in SVG 1.1 they are attributes which cannot be set with CSS.
Chrome (and Chrome clones such as Opera) supports them as CSS properties since that's what SVG 2 proposes. No other UA supports them as CSS properties currently.
Upvotes: 1