can't get the 2nd section into a grid format

The grid just doesnt look right. Need the headers above the text and the text below like a column format https://codepen.io/MD-2016/pen/YzjjezZ
MD
CodePen
CRL final
...
27 Replies
MD
MD2y ago
trying to this spaced out better and things aren't clumped
Myndi
Myndi2y ago
Which one specifically? The 3 cards section? "Mobile first", etc?
MD
MD2y ago
yeah trying to get it like this
MD
MD2y ago
Myndi
Myndi2y ago
Myndi
Myndi2y ago
Like this?
MD
MD2y ago
yes 🙂 just need more gap spacing
Myndi
Myndi2y ago
I just did this.
.first .container {
display: flex;
}

.first-item {
text-align: center;
}
.first .container {
display: flex;
}

.first-item {
text-align: center;
}
MD
MD2y ago
🤦🏻
Myndi
Myndi2y ago
Grid approach.
.first .container {
display: grid;
grid-template-colums: repeat(auto-fit, minmax(200px, 1fr));
}
.first .container {
display: grid;
grid-template-colums: repeat(auto-fit, minmax(200px, 1fr));
}
MD
MD2y ago
that's what I got was grid just no auto fit and min max
Myndi
Myndi2y ago
Myndi
Myndi2y ago
I think you might be targeting the wrong parent. Might get dizzy, but make sure you're aiming for the correct parent.
MD
MD2y ago
how do you get the spacing between the other sections and header and paragraph of this section? I think a row gap can do the header and paragraph but idk about the others if thats padding or margin
Myndi
Myndi2y ago
Myndi
Myndi2y ago
Like this?
MD
MD2y ago
yeah that's my goal
Myndi
Myndi2y ago
.first .container {
background-color: #e0dede;
display: flex;
padding: 3rem;
justify-content: between;
gap: 1em;
}

.first-item {
text-align: center;
padding: 1em;
}
.first .container {
background-color: #e0dede;
display: flex;
padding: 3rem;
justify-content: between;
gap: 1em;
}

.first-item {
text-align: center;
padding: 1em;
}
MD
MD2y ago
defeated again by padding and margins
Myndi
Myndi2y ago
Padding on the container to push the child inside, and some padding on the child for consistency, but could be just playing around for the right values.
MD
MD2y ago
indeed I did the first version using flex only I wanted to see how well grid does with it any tips on getting the margin and padding right? like any visual tool that could help besides just dev tools?
Myndi
Myndi2y ago
Just eye, try different values. 0.5em > 0.75em > 1em > etc. It's pretty common to use certain padding/margin values.
MD
MD2y ago
I know kevin suggests doing outlines with borders
Myndi
Myndi2y ago
Outlines with borders?
MD
MD2y ago
yeah outline: 2px solid red;
Myndi
Myndi2y ago
You mean, emulate a border with outline?
MD
MD2y ago
yeah
Want results from more Discord servers?
Add your server