国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁(yè)技術(shù)文章
文章詳情頁(yè)

請(qǐng)問(wèn)css3的transition屬性可否被子元素繼承?

瀏覽:120日期:2023-08-01 08:17:14

問(wèn)題描述

如題,就是給父元素設(shè)置上transition,那么子元素會(huì)有transition么?

在w3c規(guī)范里是否有這個(gè)的規(guī)范?能否給個(gè)鏈接

問(wèn)題解答

回答1:

文檔地址: http://dev.w3.org/csswg/css-transitions/CRTL+F 查'inherited'結(jié)果都是NO.這些屬性包括:

transition-propertytransition-durationtransition-timing-functiontransition-delay Propertytransition Shorthand

關(guān)于繼承性,文檔中提到了一點(diǎn)

EXAMPLE 4

An 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.

這里提到了一個(gè)場(chǎng)景,如果parent指定的transition作用到的屬性和child指定的transtions作用到的屬性是同一個(gè),而且parent的transtion過(guò)渡時(shí)間更長(zhǎng),那么就需要自己去維護(hù)transition的完成狀態(tài)(完成后移除?我注)。例如:

<p class='parent'> <p class='child'></p></p>.parent { transition: 4s text-indent;}.child{ transition: 1s text-indent;}

如有錯(cuò)誤歡迎指正。

回答2:

不能。我在谷歌下試了,不能。

回答3:

不能 https://developer.mozilla.org/en-US/docs/Web/CSS/transition請(qǐng)問(wèn)css3的transition屬性可否被子元素繼承?

標(biāo)簽: CSS
相關(guān)文章:
主站蜘蛛池模板: 彩票| 江山市| 马边| 乌拉特后旗| 新平| 英超| 泰顺县| 西安市| 肥城市| 承德县| 枣阳市| 运城市| 大石桥市| 梨树县| 房产| 梅州市| 绥化市| 钟祥市| 门头沟区| 曲松县| 大荔县| 蒙山县| 灵川县| 岢岚县| 嵊泗县| 山丹县| 都昌县| 安徽省| 成都市| 微山县| 蕲春县| 云龙县| 怀来县| 德庆县| 佛坪县| 公安县| 贵德县| 图木舒克市| 锡林郭勒盟| 屏山县| 黔西县|