DEV Community

loading...

Discussion on: Is it possible to have a responsive image in a flexbox item?

Collapse
jhomkarlo profile image
Jhomkarlo

Well, i don't know why div.funny doesn't take the width of it's contents, i prefer avoiding those and thinking differently.

You can take the img and putting as a direct child of div.parent

jsfiddle.net/ohLc5xyw/126/

I hope this work for you.

Collapse
mckabue profile image
Kabue Charles Author

thanks. i noted that when the image is a direct flex-item, it works, until it is a child of another flex item. the latter is my requirement... i also noted that when i specify the height of the image in pixels, it works, but that is half responsive... jsfiddle.net/ohLc5xyw/100/