I have a simple HTML snippet:
<div>
<img src="http://www.placehold.it/200x200"><p>LoremipsumdadeedaherpdederpIlikecoffeecoffeecoffee</p></div>
MyCSS:
div{max-width:webkit-min-content;max-width:-moz-min-content;}img{max-width:100%}
Fiddle: link
See how it looks in Firefox and shrink the window screen. This is the behavior I want: When space is available, the image is normal in size and the text will go under the image. When the image overflows, I want to shrink it. This works in Firefox.
However, the webkit version does not seem to work. Applying max-width:100%
to the image causes the image to shrink to the length of the longer word in the paragraph.
Is there a fix for this in browsers -webkit, or is this a bug?