Recently, I have been playing flexbox, and I came up with a solution for this through experimentation and the following reasoning. However, I'm not really sure that this is exactly what is happening.
If the actual width depends on a flexible system. Thus, after the width of the elements reaches the maximum width of the parent, the extra width specified in css is ignored. Then itβs safe to set the width to 100%.
Since the height of the img tag is derived from the image itself, setting the height to 0% can do something. (thatβs where I donβt understand that ... but it was clear to me that he had to fix it)
(remember, saw it here first!)
.slider { display: flex; } .slider img { height: 0%; width: 100%; margin: 0 5px; }
Only works in chrome condition
Muhammad Umer Jun 12 '15 at 2:02 2015-06-12 02:02
source share