I have the following code (Fiddle https://jsfiddle.net/49dvm6h1/39/)
<!DOCTYPE html>
<html>
<body>
<div class="outer">
<div class="inner">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
</div>
<style>
.outer {
max-width: 500px;
background: red;
}
.inner {
padding: 4px;
background: green;
display: inline-flex;
align-items: center;
flex-flow: row wrap;
gap: 4px;
}
.item {
width: 200px;
height: 50px;
background: #0000ff;
}
</style>
</body>
</html>
Is it event possible to make the green container reduce it's width to it's content without JS or Media Quieres & breakpoints?