In the process of creating a user interface, I have included clickable cards that reveal a detailed panel when clicked.
The detail panel is set to a minimum width of 900px and should adjust to the remaining space between the cards and itself.
The column containing the cards will only display a maximum number of cards per row, each with a fixed width.
https://i.stack.imgur.com/FZ8Oq.png
main{
display:flex;
max-width:calc(100vw - 20px);
background:green;
padding:10px;
justify-content:center;
}
.card{
width:180px;
height:240px;
background:blue;
margin:10px;
}
aside{
display:flex;
flex-wrap:wrap;
width:fit-content;
}
.card-detail{
background:red;
padding:10px;
width:100%;
min-width:900px;
}
<main>
<aside>
<div class="card">
Card
</div>
<div class="card">
Card
</div>
<div class="card">
Card
</div>
<div class="card">
Card
</div>
<div class="card">
Card
</div>
</aside>
<div class="card-detail">
Detail
</div>
</main>
I have created a CodePen to work on this design challenge: