The picture is shown in a completely vertical play? The width and height are uncertain.

at present, we want to achieve a function similar to Weibo thumbnails, with inconsistent width-to-height ratios, so now we need to fully display the pictures in the middle. How can it be achieved without a background map? Too wide picture, stretch height, too high picture, stretch width.

Mar.18,2021

gives you an idea. I don't know what get means without get.

first use js to scale the width and height of the picture, which is relatively easy.

then you can center horizontally and vertically in many ways;

margin-left: 50%;
margin-top: 50%;
transform: translate(-50%, -50%)

or within flex

margin:auto

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3abf2-2b9b7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3abf2-2b9b7.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?