为什么一个rect在Firefox中需要width和height属性? [英] Why does a rect require width and height attribute in Firefox?

查看:137
本文介绍了为什么一个rect在Firefox中需要width和height属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在下面的示例中,我使用CSS和SVG创建了眨动眼睛动画: http:// codepen。 io / JamesTheHacker / pen / oLZVrY

In the following example I created a blinking eyes animation using CSS and an SVG: http://codepen.io/JamesTheHacker/pen/oLZVrY

它在Chrome中正常工作,但在Firefox上,除非我特别提供width和height属性< rect>

It works fine in chrome, but on Firefox the eyes do not appear unless I specifically provide a width and height attribute on the <rect>.

没有属性,眼睛不可见。如果我添加属性CSS height 动画没有效果。

Without the attribute the eyes are not visible. If I add the attribute the CSS height animation has no effect.

推荐答案


  • 在SVG中1.1 height和width属性,即不能通过CSS设置高度和宽度。

  • 在SVG 2中,是CSS属性。

  • 到目前为止,只有Chrome实现了这部分未完成的SVG 2规范。

    Only Chrome has so far implemented this part of the unfinished SVG 2 specification.

    这篇关于为什么一个rect在Firefox中需要width和height属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆