Bread
KPCKevin Powell - Community
•Created by Bread on 10/29/2023 in #front-end
Adding image to a flex container overrides 100vh and creates a scroll bar. How to fix?
Hello,
I have the following HTML. I want to present as a simple page with hero and footer taking up the entirety of the view port.
To do so, I used the following CSS:
The problem I am having is that when I comment out the image, the page displays as I would like. But when the image is added, it expands beyond the <div> container and creates a scrollbar. I want the image to grow to fit the container, but not to cause the container itself to grow. I have spent some time trying to figure it out, Google, ChatGPT but haven't found a solution - any help would be great!
Thank you in advance,
Bread
11 replies