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. 數(shù)組按鍵值封裝!2. Docker for Mac 創(chuàng)建的dnsmasq容器連不上/不工作的問題3. docker不顯示端口映射呢?4. python - flask _sqlalchemy 能否用中文作為索引條件5. python3.x - git bash如何運(yùn)行.bat文件?6. java - 阿里的開發(fā)手冊(cè)中為什么禁用map來(lái)作為查詢的接受類?7. javascript - ES6規(guī)范下 repeat 函數(shù)報(bào)錯(cuò) Invalid count value8. html5 - 使用echarts中的圖表 一個(gè)頁(yè)面導(dǎo)入了好幾個(gè)js圖表 實(shí)現(xiàn)echarts圖表隨著瀏覽器窗口變化而變化時(shí)出現(xiàn)了問題9. javascript - webpack中alias配置中的“@”是什么意思?10. javascript - 為什么創(chuàng)建多行多列的表格最后只有一行內(nèi)有表格
