Здравствуйте.
Задание выполнил на СТО, но:
-
Что-то мне подсказывает, что можно было сделать и короче (комментарии - не в счет);
-
Не могу понять, почему, в моем случае, если к ПАЛИТРЕ-4 я ставлю :last-child вместо :nth-child(4) - у меня не срабатывает ничего?
Спасибо.
/ПАЛИТРА-1/
.palette-box:first-child .palette-small {
display: flex;
flex-direction: column;
justify-content: center;
}
.palette-box:first-child .palette-small .color-4,
.palette-box:first-child .palette-small .color-3 {
width: 20px;
}
.palette-box:first-child .palette-small .color-4 {
align-self: center;
}
.palette-box:first-child .palette-small .color-3 {
align-self: center;
}
/расположение/
.palette-box:first-child .palette-small .color-2 {
order: 3;
}
.palette-box:first-child .palette-small .color-3 {
order: 1;
}
.palette-box:first-child .palette-small .color-4 {
order: 4;
}
.palette-box:first-child .palette-small .color-5 {
order: 2;
}
/расположение/
/КОНЕЦ ПАЛИТРА-1/
/ПАЛИТРА-2/
.palette-box:nth-child(2) .palette-small {
display: flex;
flex-direction: column-reverse;
justify-content: space-between;
}
.palette-box:nth-child(2) .palette-small div {
width: 20px;
}
/расположение/
.palette-box:nth-child(2) .palette-small .color-2 {
align-self: flex-end;
}
.palette-box:nth-child(2) .palette-small .color-6 {
align-self: flex-end;
}
/расположение/
/КОНЕЦ ПАЛИТРА-2/
/ПАЛИТРА-3/
.palette-box:nth-child(3) .palette-small {
display: flex;
justify-content: space-between;
}
.palette-box:nth-child(3) .palette-small .part {
display: flex;
flex-direction: column;
justify-content: space-between;
}
/КОНЕЦ ПАЛИТРА-3/
/ПАЛИТРА-4/
.palette-box:nth-child(4) .palette-small {
display: flex;
justify-content: space-between;
}
.palette-box:nth-child(4) .palette-small .part {
display: flex;
}
.palette-box:nth-child(4) .palette-small .part:last-child {
flex-direction: column-reverse;
justify-content: space-between;
}
/КОНЕЦ ПАЛИТРА-4/