请问css3的transition属性可否被子元素继承?
问题描述
如题,就是给父元素设置上transition,那么子元素会有transition么?
在w3c规范里是否有这个的规范?能否给个链接
问题解答
回答1:文档地址: http://dev.w3.org/csswg/css-transitions/CRTL+F 查'inherited'结果都是NO.这些属性包括:
transition-propertytransition-durationtransition-timing-functiontransition-delay Propertytransition Shorthand
关于继承性,文档中提到了一点
EXAMPLE 4An example where maintaining the set of completed transitions is necessary would be a transition on an inherited property, where the parent specifies a transition of that property for a longer duration (say, transition: 4s text-indent) and a child element that inherits the parent’s value specifies a transition of the same property for a shorter duration (say, transition: 1s text-indent). Without the maintenance of this set of completed transitions, implementations could start additional transitions on the child after the initial 1 second transition on the child completes.
这里提到了一个场景,如果parent指定的transition作用到的属性和child指定的transtions作用到的属性是同一个,而且parent的transtion过渡时间更长,那么就需要自己去维护transition的完成状态(完成后移除?我注)。例如:
<p class='parent'> <p class='child'></p></p>.parent { transition: 4s text-indent;}.child{ transition: 1s text-indent;}
如有错误欢迎指正。
回答2:不能。我在谷歌下试了,不能。
回答3:不能 https://developer.mozilla.org/en-US/docs/Web/CSS/transition
相关文章:
1. html5 - input type=’file’ 上传获取的fileList对象怎么存储于浏览器?2. javascript - 微信“分享到朋友圈”自定义分享内容,无法成功调用jssdk接口,不知为何3. javascript - video标签在微信中无法正常发使用,什么情况4. html5 - vue-cli 装好了 新建项目的好了,找不到项目是怎么回事?5. ios - vue-cli开发项目webstrom会在stylus样式报错,飙红,请大神帮忙6. javascript - vue2.0中使用vue2-dropzone的demo,vue2-dropzone的github网址是什么??百度不到。7. css - 什么情况下,padding比margin更好啊8. 极光推送 - Android app消息推送 百度 极光 个推 信鸽哪个好一些?9. javascript - 请教如何获取百度贴吧新增的两个加密参数10. 为什么微信内置浏览器用$_COOKIE取不到值?
