New to flex boxes. I have a flex box with 2 boxes. The 1st box is supposed to contain an image and the second two <p>
texts. I want the first box to resize along with the image so that no extra white space is left around the area if i reduce the image size. I tried using the flex shrink property but doesnt seem to fit to reduce the flex box size when image is reduced. Can anyone help with this?
.headlineContainer{
display:flex;
border: red 2px solid;
}
#myPhoto{
border: blue 2px solid;
flex: 0 1 auto;
}
#myPhoto>img{
height:50%;
}
#myHeadline{
border: green 3px solid;
}
<div id="mainContainer" class="headlineContainer" >
<div id="myPhoto">
<img src="https://cdn3.iconfinder.com/data/icons/complete-set-icons/512/googleplus512x512.png"/>
</div>
<div id="myHeadline">
<p>Hey, This is google</p>
<p>It helps you find things</p>
</div>
</div>