Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Align multiline

I use bootstrap 5

<div class="col-lg-3 col-md-6">
    <h5 class="text-light mb-4">Stay in contact</h5>
    <p><i class="fa fa-map-marker-alt me-3"></i>619 Otaroad-north-Sidrac, New York, New York 291290 </p>
    <p><i class="fa fa-phone-alt me-3"></i><a href="tel:213-622-1212">213-622-1212</a></p>
    <p><i class="fa fa-envelope me-3"></i><a href="mailto:bob@bob.usa">bob@bob.usa</a></p>
</div>

How to align text on multiline?

Is there a way to align New York with 619?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I tried to replace p tag with span and add style: word-wrap: break-word;

with no succes

enter image description here

>Solution :

It is possible: simply apply display: flex; to the first p element, which will treat the icon and the subsequent text as two flex items. (You might want to assign a class to the p element to be able to address it more independently):

p:first-of-type {
  display: flex;
}
<div class="col-lg-3 col-md-6" style="width: 200px;">
    <h5 class="text-light mb-4">Stay in contact</h5>
    <p><i class="fa fa-map-marker-alt me-3">X&nbsp;&nbsp;&nbsp;</i>619 Otaroad-north-Sidrac, New York, New York 291290 </p>
    <p><i class="fa fa-phone-alt me-3">X&nbsp;&nbsp;&nbsp;</i><a href="tel:213-622-1212">213-622-1212</a></p>
    <p><i class="fa fa-envelope me-3">X&nbsp;&nbsp;&nbsp;</i><a href="mailto:bob@bob.usa">bob@bob.usa</a></p>
</div>
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading