Sass函式 列表函式nth

2022-05-08 18:33:12 字數 511 閱讀 2428

語法:

nth($list,$n)

nth() 函式用來指定列表中某個位置的值。不過在 sass 中,nth() 函式和其他語言不同,1 是指列表中的第乙個標籤值,2 是指列給中的第二個標籤值,依此類推。如:

>> nth(10px 20px 30px,1)

10px

>> nth((helvetica,arial,sans-serif),2)

"arial"

>> nth((1px solid red) border-top green,1)

(1px "solid" #ff0000)

注:在 nth($list,$n) 函式中的 $n 必須是大於 0 的整數:

>> nth((1px solid red) border-top green 1 ,0)

syntaxerror: list index 0 must be a non-zero integer for `nth'

scss值列表 sass列表函式

join 函式是將兩個列表連線合併成乙個列表。join 10px 20px,30px 40px 10px 20px 30px 40px join blue,red abc,def 0000ff,ff0000,aabbcc,ddeeff join blue,red abc def 0000ff,ff0...

Sass函式 值列表index

ndex 函式類似於索引一樣,主要讓你找到某個值在列表中所處的位置。在 sass 中,第乙個值就是1,第二個值就是 2,依此類推 index 1px solid red,1px 1 index 1px solid red,solid 2 index 1px solid red,red 3 在 ind...

MySQL函式列表

mysql中,提供了豐富的函式,簡化了使用者對資料的操作 包括數學函式 字串函式 日期和時間函式 條件判斷函式 加密函式等 abs x 返回x的絕對值 sqrt x 返回x的非負2次方根 mod x,y 返回x被y除后的餘數 ceiling x 返回不小於x的最小整數 floor x 返回不大於x的...