This is a solution to the Four card feature section challenge on Frontend Mentor.
Users should be able to:
- View the optimal layout for the site depending on their device's screen size
- Solution URL: Github link
- Live Site URL: Four card feature section
- Semantic HTML5 markup
- CSS
- Flexbox
- CSS Grid
I learned how to use :nth-child()
to style each class element individually:
.card:nth-child(1) {
border-top: 0.3em solid var(--cyan);
}
.card:nth-child(2) {
border-top: 0.3em solid var(--red);
}
.card:nth-child(3) {
border-top: 0.3em solid var(--orange);
}
.card:nth-child(4) {
border-top: 0.3em solid var(--blue);
}
I learned how to use CSS Grid to create layout.
main {
display: grid;
}
@media (min-width: 28em) {
main {
grid-template-columns: repeat(5, 1fr);
grid-template-rows: 5% 35% 5% 35% 5%;
}
.card {
width: 22em;
}
.card:nth-child(1) {
grid-column-start: 2;
grid-row-start: 3;
align-self: center;
}
.card:nth-child(2) {
grid-column-start: 3;
grid-row-start: 2;
align-self: end;
}
.card:nth-child(3) {
grid-column-start: 3;
grid-row-start: 4;
align-self: start;
}
.card:nth-child(4) {
grid-column-start: 4;
grid-row-start: 3;
align-self: center;
}
}
I still need to practice the positioning an element & @media
. I also need to learn about responsive CSS in general & HTML5 rules.
- Grid Garden - This was a fun game to practice grid fundamentals.
- Flexbox Froggy - This was a fun game to practice flexbox fundamentals.
- Frontend Mentor - @snigdha-sukun