css3 - sass中Mixins中each循環(huá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; }
問題解答
回答1:@mixin css3after($property, $value) { @each $prefix in -webkit-, -moz-, -ms-, -o-, ’’ {#{$property}: #{$prefix}#{$value}; }}
這樣試試,屬性名應(yīng)該用這種形式
相關(guān)文章:
1. phpstudy8.1沒集成mysql-front2. 關(guān)docker hub上有些鏡像的tag被標(biāo)記““This image has vulnerabilities””3. node.js - mongodb查找子對象的名稱為某個值的對象的方法4. docker鏡像push報錯5. Docker for Mac 創(chuàng)建的dnsmasq容器連不上/不工作的問題6. javascript - 在 model里定義的 引用表模型時,model為undefined。7. 運(yùn)行python程序時出現(xiàn)“應(yīng)用程序發(fā)生異常”的內(nèi)存錯誤?8. javascript - QQ第三方登錄的問題9. 利用IPMI遠(yuǎn)程安裝centos報錯!10. html5 - datatables 加載不出來數(shù)據(jù)。

網(wǎng)公網(wǎng)安備