#CSS grid solo project BBC News Clone help
2 messages · Page 1 of 1 (latest)
Hi @charred stratus ,
You featured-article is currently taking up one cell of the main grid because it's display: block. You need to set it up as a grid itself, too.
See screenshot 1
First step:
.featured-article {
display: grid;
grid-column: 1 / 4;
}
Now, you will notice that doing this does not align our new grid to the parent grid. See screenshot 2.
A solution (I don't know if the course covers it?) is using subgrid.
Subgrid allows a grid child to follow its parent's columns and rows definitions. When using subgrid, it’s a kind of letting the featured-article inherit the grid-template-columns value from its parent (the .main grid).
So, we just need to finally add grid-template-columns: subgrid to our .featured-article, and TADA.
Working solution:
.featured-article {
display: grid;
grid-template-columns: subgrid;
grid-column: 1/4;
}
See screenshot 3.