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
KoichaOP•3y ago
Koicha
KoichaOP•3y ago
so basically it needs to be like this result
MarkBoots
MarkBoots•3y ago
use display grid
Koicha
KoichaOP•3y ago
and what other CSS properties do I need to add besides the display: grid?
Koicha
KoichaOP•3y ago
hmm I am getting this
Koicha
KoichaOP•3y ago
MarkBoots
MarkBoots•3y ago
you dont have to set any sizes on the childs otherwise, make a codepen so I/we can check
Koicha
KoichaOP•3y 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•3y ago
well, you can copy the rendered html and css from the devtools
Koicha
KoichaOP•3y ago
true! Let me try it out!
Koicha
KoichaOP•3y ago
there!
MarkBoots
MarkBoots•3y 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
KoichaOP•3y ago
isn't it directly on the single .option class name? that is because the class name is .button-select > .option {...}
MarkBoots
MarkBoots•3y ago
the grid defines the template where in the childs are placed. You have an options group (grid) with single options (grid items)
Koicha
KoichaOP•3y 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•3y ago
Koicha
KoichaOP•3y 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•3y ago
it is the div wrapping the single items. so thats the place to set the grid
Koicha
KoichaOP•3y ago
yes! exactly! 😄
Want results from more Discord servers?
Add your server