I am currently facing a challenge with aligning a Font Awesome icon horizontally and vertically within Bootstrap 4. I am aiming to achieve this using only the built-in CSS provided by Bootstrap 4, without the need for any custom CSS.
While I have been successful in centering the icon vertically using align-self-center
, I am encountering difficulties with horizontal alignment. Despite using justify-content-center
, the icon remains left-aligned.
<div class="row">
<div class="col-6">
<h2 class="text-left">Heading 2</h2>
<p class="text-justify">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas accumsan sit amet augue eu suscipit. Maecenas rutrum, mauris nec porta euismod, ligula augue facilisis purus, non ultricies mi nulla lacinia velit. Ut vitae varius odio, vel pharetra nisi. Nam porta, ex eu ornare sollicitudin, erat erat elementum ligula, aliquet commodo.</p>
<p class="text-justify">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas accumsan sit amet augue eu suscipit. Maecenas rutrum, mauris nec porta euismod, ligula augue facilisis purus, non ultricies mi nulla lacinia velit. Ut vitae varius odio, vel pharetra nisi. Nam porta, ex eu ornare sollicitudin, erat erat elementum ligula, aliquet commodo.</p>
</div>
<div class="col-6 align-self-center justify-content-center">
<i class="far fa-thumbs-up fa-10x"></i>
</div>
</div>