How to split a div into even sections?
I have these sections defined in my
main
element that's set as a grid. I want to be able to split the sections into columns that I can assign individual images to. For instance as shown in the second image.
The other two sections would be handled the same way. Since there's only 3 items in the first section, I'd like it to be split into 3 columns, but in the other two sections where there's 8 items, I'd like it to be split into 2 rows of 4 columns. Is this something that'd be easy to achieve with flexbox? I can provide code if needed.26 Replies
Each of those panels are
section
tags inside of a main
element gridUse grid
I guess that might be better
oh subgrid is a thing
it is but you dont need this here
How would I go about making them take up a third of the space?
Also if it helps
All of those
section
tags are inside of <main class="main_container">
This is what you want to achive right?
the first panel has all of the items in the right place, I just need them to take up a third of it each
grid seems correctly set up
Actually I guess it makes sense that only the text part is getting lit up since there's only really a
<p>
tag thereawesome, thank you so much
really readable as well
np
okay it's the
place-items: center
that's messing it upI want to centralize the text
Why does it say that the grid only has 1 column?
:peepoShrug:
Check your devtools
if I enable div.grid it shows all
and where are you placing
place-items: center
?
need to have them as different sections
why
also you didnt asnwer my question
my bad
and about needing separate sections was my brain not braining