Here is the HTML code I am working with:
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<div class="container">
<div class="row">
<div class="col-lg-9 col-md-12">
<div class="container">
<div class="row bg-white">
<div class="col-lg-4 col-md-6 p-2">
<div class="card">
<div class="card-img">
<img src="#image" class="img-fluid">
</div>
<div class="card-img-overlay">
<div class="card-title">
<h5><a href="#">Title</a></h5>
</div>
<div class="card-text">
some texts
<div class="dlbut p-2">
<center>
<h5><a href="#">link</a></h5>
</center>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 p-2">
<div class="card">
<div class="card-img">
<img src="#image" class="img-fluid">
</div>
<div class="card-img-overlay">
<div class="card-title">
<h5><a href="#">Title</a></h5>
</div>
<div class="card-text">
some texts
<div class="dlbut p-2">
<center>
<h5><a href="#">link</a></h5>
</center>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
I am encountering an issue with the column structure in my code. The first column, set to col-lg-9 col-md-12
, works correctly on medium devices. However, the second column, set to col-lg-4 col-md-6
, is not behaving as expected on small devices. I want it to take up half of the screen width on tablets and the full screen width on mobile phones, but it remains half-width on smaller screens too. I tried adding col-sm-12
with no success. Despite researching various solutions, including removing the second container
, the issue persists.