grid-auto-rows impossible to change?
when a grid has this setting, is it impossible to define the last child to not stretch and have a different height?
4 Replies
you can just do
:last-child
and height: 500px
also place-self: start
should prevent it from stretching I thinkyou can just set align-self on the one you dont want to stretch
No need to set a height on it if you just want it to be as tall as it's contents
the element inside the last row doesn't stretch, but the row does! adding a height to the last grid row does nothing on my end. I wanted to have all grid rows stretched, except for the last row, that should fit its content height.
Without your code it's anyone's guess. If it's set to min-content and is still taller then you think it should be, there must be some padding or margin set on the element that lives in the last row. You can try giving that element a bg , outline, or drop shadow to visualize it (and/or use your dev tools to hover on it.)
If you still need help please put your code into a https://codepen.io ✨️
CodePen
An online code editor, learning environment, and community for front-end web development using HTML, CSS and JavaScript code snippets, projects, and web applications.