I would like my modal to contain three elements: On the left: a button In the center: a title On the right: a close button
At first glance, it may appear that I have achieved this layout, but in reality, my title is not properly centered. Here's the code snippet:
.modal-dialog {
max-width: 90%;
}
.modal-header {
border: none;
}
.modal-title-filter {
color: #2D2D2D;
font-size: 1.2em;
text-align: center;
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<!-- Header -->
<div class="modal-header">
<button class="btn btn-primary">Clear Filters</button>
<h5 class="modal-title modal-title-filter w-100 text-center" id="exampleModalLabel">Filters</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<!-- /Header -->