請(qǐng)問(wèn)css3的transition屬性可否被子元素繼承?
問(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 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.
這里提到了一個(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
相關(guān)文章:
1. Python處理Dict生成json2. (python)關(guān)于如何做到按win+R再輸入文件文件名就可以運(yùn)行?3. 想練支付寶對(duì)接和微信支付對(duì)接開(kāi)發(fā)(Java),好像個(gè)人不可以,怎么弄個(gè)企業(yè)的4. mysql - Sql union 操作5. java - Mybatis 數(shù)據(jù)庫(kù)多表關(guān)聯(lián)分頁(yè)的問(wèn)題6. 急急急!!!求大神解答網(wǎng)站評(píng)論問(wèn)題,有大神幫幫小弟嗎7. javascript - 按鈕鏈接到另一個(gè)網(wǎng)址 怎么通過(guò)百度統(tǒng)計(jì)計(jì)算按鈕的點(diǎn)擊數(shù)量8. python - 如何使用websocket在網(wǎng)頁(yè)上動(dòng)態(tài)示實(shí)時(shí)數(shù)據(jù)的折線圖?9. python - 請(qǐng)問(wèn)這兩個(gè)地方是為什么呢?10. python2.7 - python 正則前瞻 后瞻 無(wú)法匹配到正確的內(nèi)容
