I have come across a problem when optimizing a simple site for mobile/small viewport viewing. I have 5 images, displayed immediately next to each other and have set the width to 20% with no margin, padding or anything else. However, when the viewport is reduced to the point where the images should be scaled, the last always wraps to a new line. I have created a simple test and seen this behaviour in IE and Chrome:
<html>
<head>
<title>Image test</title>
</head>
<body>
<img style="width:20%; max-width: 150px;" src="../images/image.png" alt="" />
<img style="width:20%; max-width: 150px;" src="../images/image.png" alt="" />
<img style="width:20%; max-width: 150px;" src="../images/image.png" alt="" />
<img style="width:20%; max-width: 150px;" src="../images/image.png" alt="" />
<img style="width:20%; max-width: 150px;" src="../images/image.png" alt="" />
</body>
</html>
As far as I understand, the images should never wrap since the total width of the images will never total more than 100% of the parent element.
Is this a known issue or am I missing something fundamental.