Trying to get width and height consistent same size

I am am trying to make the box that says from 5 to 10 meters to be same width and height for the 11 to 15 meters. Here is my CSS code:
.option {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
padding: $space-l;
width: max-content;
background: #fff;
border: solid 2px $gray-support;
border-radius: $space-xs;
cursor: pointer;
}
.option {
display: flex;
align-items: center;
justify-content: center;
flex: 1;
padding: $space-l;
width: max-content;
background: #fff;
border: solid 2px $gray-support;
border-radius: $space-xs;
cursor: pointer;
}
Does anyone know what I am missing here?
21 Replies
Koicha
Koicha•2y ago
Koicha
Koicha•2y ago
so basically it needs to be like this result
MarkBoots
MarkBoots•2y ago
use display grid
Koicha
Koicha•2y ago
and what other CSS properties do I need to add besides the display: grid?
Koicha
Koicha•2y ago
hmm I am getting this
Koicha
Koicha•2y ago
MarkBoots
MarkBoots•2y ago
you dont have to set any sizes on the childs otherwise, make a codepen so I/we can check
Koicha
Koicha•2y ago
ah, true lol, I am sitting on a Vue project, so not very easy to try and replicate it on the codepen
MarkBoots
MarkBoots•2y ago
well, you can copy the rendered html and css from the devtools
Koicha
Koicha•2y ago
true! Let me try it out!
Koicha
Koicha•2y ago
there!
MarkBoots
MarkBoots•2y ago
you have set the grid on the single options, you need to set in on the group and remove the margin from the .option (gap will take care of that)
Koicha
Koicha•2y ago
isn't it directly on the single .option class name? that is because the class name is .button-select > .option {...}
MarkBoots
MarkBoots•2y ago
the grid defines the template where in the childs are placed. You have an options group (grid) with single options (grid items)
Koicha
Koicha•2y ago
sure! In this case, the option group is the parent element which I am using the CSS grid class. Isn't it correct what I did?
MarkBoots
MarkBoots•2y ago
Koicha
Koicha•2y ago
ooooh! thank you so much for your help Mark! I wasn't aware the .button-select is the place I needed to add the grid!
MarkBoots
MarkBoots•2y ago
it is the div wrapping the single items. so thats the place to set the grid
Koicha
Koicha•2y ago
yes! exactly! 😄
Want results from more Discord servers?
Add your server