I'm currently working on creating a chat application and I need the chat bubbles to snugly wrap around their contents. It's working fine for text, but when an image is included in the bubble, it creates some issues. Below is the HTML code that I am using:
<div class="fromMe msgBubble">
<img src="{{image.location}}" style="width:50%;">
<br>
<span class="msgDate">2011-01-26 01:52:16</span>
</div>
<div class="clearfix"></div>
However, when the image is loaded, there is a lot of extra padding next to the image, causing the div not to tightly wrap around it. This is how it looks:
https://i.sstatic.net/RXbLT.jpg
UPDATE: I have shared a JS Fiddle with the code and CSS. https://jsfiddle.net/dw9aek2y/
Is there a way to make the chat bubble div fit tightly around the picture? Thank you!