JSFiddle - React, Tailwind, and code Playground
by Kikketer
HTML
<div class="overwrap">
<div class="ac-container">
<div class="ac-image"><img src="//i.imgur.com/78UIcao.jpg" class="med"></div>
</div>
<div class="ac-container">
<p>Hello there, I would like this really long bit of text to influence the size of this column and as such overlap the image on the left. I would like however to not have this text overlap the image, but in this case have the image shrink accordingly to the available space inside the flex column.</p>
</div>
</div>
CSS
.overwrap {
width: 300px;
border: 1px solid red;
display: flex;
overflow: hidden;
justify-content: flex-start;
box-sizing: border-box;
}
.ac-container {
padding: 0px;
min-width: 0px;
flex: 1 1 auto;
box-sizing: border-box;
}
.ac-image {
display: flex;
align-items: flex-start;
justify-content: flex-start;
box-sizing: border-box;
}
img {
max-height: 100%;
max-width: 80px;
}
img.med {
max-height: 100%;
max-width: 80px;
}
p {
margin-top: 0;
margin-bottom: 0;
}