css3 - sass中Mixins中each循環(huán)的問(wèn)題
問(wèn)題描述
@mixin css3($property, $value) { @each $prefix in -webkit-, -moz-, -ms-, -o-, ’’ {#{$prefix}#{$property}: $value; }}@mixin css3after($property, $value) { @each $prefix in -webkit-, -moz-, -ms-, -o-, ’’ {$property: #{$prefix}#{$value}; }}header{ @include css3after(display,box);}.border_radius { @include css3(transition, 0.5s);}
為什么 .border_radius 的引用是成功的,但是 header的就是失敗的??
.border_radius成功后是這樣的:
.border_radius { -webkit-transition: 0.5s; -moz-transition: 0.5s; -ms-transition: 0.5s; -o-transition: 0.5s; transition: 0.5s; }
問(wèn)題解答
回答1:@mixin css3after($property, $value) { @each $prefix in -webkit-, -moz-, -ms-, -o-, ’’ {#{$property}: #{$prefix}#{$value}; }}
這樣試試,屬性名應(yīng)該用這種形式
相關(guān)文章:
1. docker安裝后出現(xiàn)Cannot connect to the Docker daemon.2. 為什么我ping不通我的docker容器呢???3. android - webview 自定義加載進(jìn)度條4. mysql - 怎么讓 SELECT 1+null 等于 15. javascript - 微信音樂(lè)分享6. 網(wǎng)頁(yè)爬蟲(chóng) - 用Python3的requests庫(kù)模擬登陸B(tài)ilibili總是提示驗(yàn)證碼錯(cuò)誤怎么辦?7. javascript - 微信小程序封裝定位問(wèn)題(封裝異步并可能多次請(qǐng)求)8. 并發(fā)模型 - python將進(jìn)程池放在裝飾器里為什么不生效也沒(méi)報(bào)錯(cuò)9. linux - openSUSE 上,如何使用 QQ?10. python 怎樣用pickle保存類(lèi)的實(shí)例?
