Sass nth() Function
You are Here:
Sass nth() Function
The nth()
function returns the element of a list at the specified index.
Example
SASS TO CSS CONVERTER
//Check your console
@debug nth(10px 20px 30px, 2); // 20px
@debug nth(['#fff', '#000', '#8c8c8c'], -1); // #8c8c8c
Syntax
nth($list, $n)
Parameter Value
Value | Type | Explanation |
---|---|---|
$list | Required | Specifies a list. |
$n | Required | Specifies the index value in the list.
|
Return Value
Value | Explanation |
---|---|
string | Returns the element of $list at index $n. |
Reminder
Hi Developers, we almost covered 99.1% of Sass Tutorials with examples for quick and easy learning.
We are working to cover every Single Concept in Sass.
Please do google search for:
Join Our Channel
Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.
This channel is primarily useful for Full Stack Web Developer.