sheepman
sheepman
KPCKevin Powell - Community
Created by sheepman on 8/28/2023 in #front-end
Vanilla CSS: Make flex-wrap always wrap more than one item?
When the screen is wide enough, I would like all elements inside my flexbox side by side. However, at certain screen sizes, flex-wrap just puts one item on the second line, and I don't like the look of it. Is there a way to force flex-wrap to always keep the two rows roughly the same width? Or can I do this better with grid?
1 replies
KPCKevin Powell - Community
Created by sheepman on 6/13/2023 in #front-end
Resize image to max height of height: auto container - this seems like it should be easy.
Rather than trying to explain what I'm doing, here's a codepen: https://codepen.io/sheepman4267/pen/zYMvJbY I want the div to be the minimum height of the text it contains, and I want the image to grow/shrink with that. Logically, it seems to me like height: min-content on the div and height: auto on the image should do this, but it doesn't. Is there a pure CSS way to do this, or am I going to have to mess with JS?
5 replies