美文网首页
Sass列表函数-nth()

Sass列表函数-nth()

作者: 混吃等死小前端 | 来源:发表于2020-02-20 17:15 被阅读0次

用来指定列表中某个位置的值

nth($list,$n)第一个参数是列表本身,第二个参数是要取出的值的索引(索引从1开始,而不是0,必须是大于 0 的整数)

第一个参数列表使用逗号隔开时需要加上[]

@debug nth(10px 12px 16px, 1); // 10px
@debug nth([line1, line2, line3], -1); // line3

相关文章

网友评论

      本文标题:Sass列表函数-nth()

      本文链接:https://www.haomeiwen.com/subject/xhoxqhtx.html