Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1675

Can CSS grid elements shrink at a known ratio?

$
0
0

I have a flexbox where all elements shrink proportionally (size ratio 2:1:2) and only one element grows if more space than 400px + 200px + 400px is available:

div {  outline: 1px solid;}
<div style="display: flex;"><div style="flex: 0 1 400px;">this can shrink</div><div style="flex: 1 1 200px;">this can shrink and grow</div><div style="flex: 0 1 400px;">this can shrink</div></div>

Is it possible to achieve this with CSS grid?

fr units can't be used in the first argument of minmax().


Viewing all articles
Browse latest Browse all 1675

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>