current position:Home>CSS aspect-ratio All In One

CSS aspect-ratio All In One

2022-04-29 06:47:53Game programming

CSS aspect-ratio All In One

CSS aspect-ratio All In One - The first 1 Zhang
<div class="row">  <div style="--ratio: 4 / 3;" class="item">4:3</div>  <div style="--ratio: 2 / 3;" class="item">2:3</div></div>
.row {  display: flex;  gap: 1rem;}.item {  flex-basis: 0;  aspect-ratio: var(--ratio);  flex-grow: calc(var(--ratio));}

refs



xgqfrms 2012-2020 > www.cnblogs.com/xgqfrms Use of published articles : Only registered users are allowed to access !

Original article , copyright ️xgqfrms, Prohibited reproduced ️, Infringement must be investigated ️!


author :xgqfrms

Game programming ️, A game development favorite ~

If the picture is not displayed for a long time , Please use Chrome Kernel browser .

copyright notice
author[Game programming],Please bring the original link to reprint, thank you.
https://en.qdmana.com/2022/116/202204260850284569.html

Random recommended