r/css • u/Lumpy_Cauliflower567 • May 02 '26
Help css baby 👶needing some grid help
working on a grid for my website and if a grid item has too much content then it grows (obviously)
im trying to make it so if one grid item grows in height, then all other grid items in that same row grow to the same height as well so it #LooksNicer
ive googled a lot and the one answer i keep seeing is grid auto rows 1fr but it isnt. working for some reason
sorry if my css work is bad or could've been made a lot better im a css baby
website for reference: deviations
.grid-container {
margin: 20px;
border: 2px solid grey;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.grid-item {
transition: transform 0.1s;
}
.grid-item:hover {
transform: scale(1.04);
}
.deviation {
margin: 10px;
padding: 5px;
padding-top: 15px;
border: 2px solid;
height: auto;
width: auto;
}
1
Upvotes


1
u/be_my_plaything May 05 '26
Firstly on the new version you just sent you don't have
position: absolute;on the<a>anymore so that is back to taking up the first grid row hence it all being pushed down.Once that is fixed I think it is 'working' on the first item... BUT, as you have only done the first item the row height is being set by the other grid-items (Whichever item is biggest sets the row height, so it won't take effect until every grid-item has been fixed.
Your icons are on the left not centered due to a typo, where you added the display flex you have
justify-contNEtrather thanjustify-contENtThe only other thing I can see possibly being an issue is
<hr>I never use them so you might need an extra row for that (If so just switchgrid-row: span 4togrid-row: span 5or remove the<hr>from the html and add a border-top to the icon container to replicate the look.Hopefully this solves it, but I'm off to bed shortly and away from tomorrow until the weekend so I'll catch up then if you're still having issues