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. docker-machine添加一個已有的docker主機問題2. angular.js - angularjs的自定義過濾器如何給文字加顏色?3. angular.js使用$resource服務(wù)把數(shù)據(jù)存入mongodb的問題。4. 關(guān)于docker下的nginx壓力測試5. 為什么我ping不通我的docker容器呢???6. docker安裝后出現(xiàn)Cannot connect to the Docker daemon.7. nignx - docker內(nèi)nginx 80端口被占用8. docker - 如何修改運行中容器的配置9. Docker for Mac 創(chuàng)建的dnsmasq容器連不上/不工作的問題10. docker鏡像push報錯
