I have a generic flex container I'm using for my site, with a fixed-width sidebar and a main content area that with grow with the window. This works fine when the main area has only text, but if images that are too large are inserted into the content the area will expand beyond the containing div. How can I make it so the image will be resized to fit the flex-main container? Here's my CSS code:
.generic-flex-container
{
display: flex;
margin: auto;
margin-bottom: 50px;
max-width: 1280px;
overflow: hidden;
width: 90%;
.flex-main
{
flex: 1 1;
padding-right: 20px;
}
.flex-sidebar
{
border-left: 1px solid lightgrey;
flex: 0 0 300px;
padding-left: 20px;
}
}