I've encountered an unexpected margin bottom issue while working on some HTML and Bootstrap code. No matter how I try to set the div margin to 0 in a separate stylesheet, like this:
body {
margin: 0;
}
div {
margin-bottom: 0;
}
The problem persists. Do any of you know why this is happening?
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="81e3eeeef5f2f5f3e0f1c1b4afb3afb2">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-rbsA2VBKQhggwzxH7pPCaAqO46MgnOM80zW1RWuH61DGLwZJEdK2Kadq2F9CUG65" crossorigin="anonymous">
<div id="sup" class="bg-danger p-4 h1">
Title
</div>
<div class="bg-dark">
<ul class="d-flex flex-row justify-content-end list-unstyled">
<li class="m-3 p-3 bg-light">
Home
</li>
<li class="m-3 p-3 bg-light">
About
</li>
<li class="m-3 p-3 bg-light">
Products
</li>
</ul>
</div>
<div class="bg-warning p-5 h1 d-flex justify-content-between">
<div class="m-4">
it will content image
</div>
<div class="card m-4" style="width: 18rem;">
<div class="card-body">
<h5 class="card-title">Contact us</h5>
<p class="card-text h6"></p>
<p class="card-text h6">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
<a href="#" class="btn btn-primary">Contact Now</a>
</div>
</div>
</div>