Challenge: Practice Structural Pseudo-Classes
Task
We are working with a set of elements, and the goal is to practice applying different colors using structural pseudo-classes. Your task is as follows:
- Apply the color
redto the first element using a structural pseudo-class. - Apply the color
blueto the last element using a structural pseudo-class. - Apply the color
greento every second element using a structural pseudo-class.
index.html
index.css
:first-child: Targets the first child of a parent element.:last-child: Targets the last child of a parent element.:nth-child(): Targets a specific child of a parent element based on its position in the list. For instance, to select every second list item (2, 4, 6, etc.), you can use:nth-child(2n).
index.html
index.css
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 1. Розділ 22
Запитати АІ
Запитати АІ
Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат
Чудово!
Completion показник покращився до 2.56
Challenge: Practice Structural Pseudo-Classes
Свайпніть щоб показати меню
Task
We are working with a set of elements, and the goal is to practice applying different colors using structural pseudo-classes. Your task is as follows:
- Apply the color
redto the first element using a structural pseudo-class. - Apply the color
blueto the last element using a structural pseudo-class. - Apply the color
greento every second element using a structural pseudo-class.
index.html
index.css
:first-child: Targets the first child of a parent element.:last-child: Targets the last child of a parent element.:nth-child(): Targets a specific child of a parent element based on its position in the list. For instance, to select every second list item (2, 4, 6, etc.), you can use:nth-child(2n).
index.html
index.css
Все було зрозуміло?
Дякуємо за ваш відгук!
Секція 1. Розділ 22