My goal is to center multiple images within their respective divs, but I am facing issues with vertical alignment not working as intended. Even the CSS classes d-flex justify-content-end
and text-center
are failing to align the icons side by side. I need the icons to be centered within their divs, so I utilized the align-items-center
class for this purpose. However, the icons remain fixed at the top center instead of being perfectly centered. Is there something I am overlooking? The Bootstrap documentation only mentions using it with d-flex, which I have already done.
/* .navicons {
float: right !important
} */
// CSS code snippet omitted for brevity
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" rel="stylesheet" >
<div class="row">
<div class="col-md-9">
</div>
<div class="col-md-3 navicons">
<div class="text-center iconwrap d-flex justify-content-end">
<div class="d-inline-block navicons1 d-flex align-items-center">
<div class="naviconshov1"><img src="https://i.imgur.com/FMb2eun.gif" alt="account"/></div>
<a href="index.html"><img src="https://i.imgur.com/6w5w1r8.gif" alt="account"/></a>
</div>
// Additional HTML markup removed for succinctness
I also experimented with the following code to address the issue, yet the result remains unchanged with the icons staying in the top left corner:
.navicons {
float: right !important;
}
.iconwrap {
width: 100%;
min-height: 35px;
vertical-align: middle;
}
// Further CSS styles defined but omitted here
<div class="row">
<div class="col-md-9">
</div>
<div class="col-md-3 navicons">
<div class="d-flex align-items-center iconwrap">
<div class="d-inline-block float-right navicons1">
<div class="naviconshov1"><img src="https://i.imgur.com/FMb2eun.gif" alt="account"/></div>
<a href="index.html"><img src="https://i.imgur.com/6w5w1r8.gif" alt="account"/></a>
</div>
// More HTML markup removed for clarity