SVG在变换中消失在firefox中

时间:2020-11-28 20:30:48

In Safari all is well, in Firefox, the svg is not the correct size and when I transform it, it disappears. I'm running Safari Mac 5.1.7 and Firefox Mac 15.0.

在Safari中一切都很好,在Firefox中,svg的大小不正确,当我转换它时,它就会消失。我正在运行Safari Mac 5.1.7和Firefox Mac 15.0。

The code was created with d3 but I've just supplied the html.

代码是用d3创建的,但我刚刚提供了html。

Now you see it: http://bl.ocks.org/3531350

现在你看到它:http://bl.ocks.org/3531350

Now you don't: http://bl.ocks.org/3531267 (edited so it works now)

现在你不要:http://bl.ocks.org/3531267(编辑所以现在有效)

I imagine I have made a foolish mistake somewhere but I just can't see it!

我想我在某处犯了一个愚蠢的错误,但我看不到它!

1 个解决方案

#1


2  

I can see the svg at the bottom of the grey area if I add height and width attributes of 100% to the outer svg element. They do really need to be there if you are using svg embedded in html. I suspect Safari will require width/height in embedded svg at some point.

如果我向外部svg元素添加100%的高度和宽度属性,我可以在灰色区域的底部看到svg。如果你使用嵌入在html中的svg,他们确实需要在那里。我怀疑Safari在某些时候需要嵌入式svg的宽度/高度。

#1


2  

I can see the svg at the bottom of the grey area if I add height and width attributes of 100% to the outer svg element. They do really need to be there if you are using svg embedded in html. I suspect Safari will require width/height in embedded svg at some point.

如果我向外部svg元素添加100%的高度和宽度属性,我可以在灰色区域的底部看到svg。如果你使用嵌入在html中的svg,他们确实需要在那里。我怀疑Safari在某些时候需要嵌入式svg的宽度/高度。

相关文章