【发布时间】:2018-08-20 13:30:18
【问题描述】:
你可以在元素中声明Properties/Presentation attributes:
<rect width="50" height="50" fill="blue" />
或者你可以在style-attribute 中声明它们,如果元素支持的话:
<rect width="50" height="50" style="fill:blue;" />
但是,一些元素不支持style-属性,但它们支持一些Properties/Presentation attributes。一个例子是Animate-element。
为什么不是所有支持Properties/Presentation attributes 的元素都不支持style-属性?
【问题讨论】:
-
为什么要设置动画样式?这样做是没有逻辑的......动画是为了添加一个动作而不是一个元素
-
'animate' 元素用于随着时间的推移为单个属性或属性设置动画 ---> 那么这里样式的目的是什么?样式什么?
-
@Temani Afif:为什么要使用
animate-元素可以包含的多个Presentation attributes中的任何一个?为什么不能在style-attribute 中声明这些properties?我说的是一般的这类元素,而不是特别是animate。 -
因为它们不是用来设置元素样式的
-
<animate attributeType="CSS" attributeName="opacity" from="1" to="0" dur="5s" repeatCount="indefinite" />--> from 是一种风格??不... rect 的填充是一种风格?是的
标签: css svg properties attributes specifications