How can I horizontally center an image within a <span>
element?
https://i.sstatic.net/40IL0.png
<div class="col-1">
<span class="dot">
<h:graphicImage library="imgs" name="campus.png" width="25" height="25" style="align-content-center"/>
</span>
</div>
dot css
.dot {
height: 75px;
width: 75px;
background-color: #bbb;
border-radius: 50%;
display: inline-block;
}
No need to be concerned about the usage of h:graphicImage
, as it is a tag specific to JSF that gets translated to <img>
in html. Any html class can still be applied to it.
The implementation includes Bootstrap 4.3.