It's better to use a waterfall stream to show photos. My idea is to insert an image, when the image length and width ratio remain unchanged and the height is less than 250, a loop is completed, that is, this row is inserted into the waterfall stream to show the photo, which is even better, the following is an implementation method of waterfall stream (the length of each line is equal to the length of the browser window). You can also use css3 to implement it. It's very simple. You will know it by Google.
My idea is to insert an image. When the image length and width ratio remain unchanged and the height is lower than 250, a loop is completed, that is, this row is inserted.
Then insert the next row in the next loop. The formula is very simple. If the current height of this row is h, a picture with a height and a width of (x, y) is inserted to meet the following requirements:
H '* (w/h + y/x) = w
W is the width of the browser window,
Then H' = w/(w/h + y/x );
The Code is as follows: