css3 - sass中Mixins中each循環的問題
問題描述
@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}; }}
這樣試試,屬性名應該用這種形式
相關文章:
1. android - 分享到微信,如何快速轉換成字節數組2. 解決Android webview設置cookie和cookie丟失的問題3. javascript - 能否讓vue-cli的express修改express重啟服務4. angular.js - Beego 與 AngularJS的模板格式沖突,該怎么解決?5. node.js - npm一直提示proxy有問題6. 網頁爬蟲 - Python爬蟲入門知識7. Navicat for mysql 中以json格式儲存的數據存在大量反斜杠,如何去除?8. javascript - 有沒有iOS微信中可以在背景播放視頻的方法?9. python - flask template file not found10. mysql怎么多表刪除啊?
