Exploring the given markup with Bootstrap classes:
- The layout showcases two cards aligned left and right using
flex-row
. - These cards are adjusted to fit the available vertical space using
flex-fill
. - Although the cards occupy the vertical space, their content should scroll if it extends beyond the card. A demonstration of this is shown using the
.example-large-content
class. - The cards have a shadow effect applied.
html,
body {
overscroll-behavior: none;
}
.example-large-content {
min-height: 20rem;
}
<head>
<link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="4f2d20203b3c3b3b32e1ca617c617c">[email protected]</a>/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="d-flex flex-column vh-100 bg-light p-5">
<main class="d-flex flex-row flex-fill gap-3 overflow-auto">
<div class="card border-0 rounded-4 flex-fill shadow">
<div class="card-body d-flex flex-column gap-3 overflow-auto">
<div class="example-large-content p-3 rounded-2 bg-danger">
Large content
</div>
<div class="example-large-content p-3 rounded-2 bg-warning">
Large content
</div>
</div>
</div>
<div class="card border-0 rounded-4 flex-fill shadow">
<div class="card-body d-flex flex-column gap-3 overflow-auto">
<div class="example-large-content p-3 rounded-2 bg-danger">
Large content
</div>
<div class="example-large-content p-3 rounded-2 bg-warning">
Large content
</div>
<div class="example-large-content p-3 rounded-2 bg-success">
Large content
</div>
<div class="example-large-content p-3 rounded-2 bg-primary">
Large content
</div>
<div class="example-large-content p-3 rounded-2 bg-info">
Large content
</div>
</div>
</div>
</main>
<script src="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="294b46465d5a5d56255a6f7c616c">[email protected]</a>/dist/js/bootstrap.bundle.min.js"></script>
</body>
An issue arises when using overflow-auto
and shadow
together. The shadows on the far-left, far-right, and bottom sides appear cut off, yet they are visible in the gap between the left and right cards:
https://i.sstatic.net/82nWrlGT.png
Is there a solution to this problem?