Is it possible to achieve two different layouts with Bootstrap 5 based on the viewport size?
I want to avoid using display:none
and JS/Jquery tricks if possible.
I attempted to accomplish this by utilizing Bootstrap 5 tools, but encountered issues on larger screens:
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="294b46465d5a5d5d6f4e091c071b071a">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<div class="container-fluid">
<div class="row">
<div class="col-4 col-xxl-4 col-md-4 bg-primary">
<div class="card">1</div>
</div>
<div class="col-4 col-xxl-4 col-md-8 order-md-2 order-xxl-3 bg-success">
<div class="card">2</div>
</div>
<div class="col-xxl-8 col-md-12 order-md-3 order-xxl-2 bg-warning">
<div class="card">3</div>
</div>
</div>
</div>
The layout doesn't behave as expected on large screens (works fine on small screens with the provided code) :
Appreciate any insights or assistance, thank you!