need help with centering divs

  • This topic has 2 replies, 2 voices, and was last updated 5 years ago by Support. This post has been viewed 802 times
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #10038681
    mooncave
    Participant

    Hello,
    I am working on my “our team” section.
    There were 4 sections for 4 people.
    Now I removed the div of one person, so the other three are not aligned at the center anymore! How can I fix this?

    the structure kinda looks like this:

    <div class=”row pt-5 mt-5 mb-4″>Caption/Text of section</div>

    <div class=”row pb-5 mb-5>
    <div class=”col-sm-6 col-lg-3 mb-4 mb-lg-0″> Person 1</div>
    <div class=”col-sm-6 col-lg-3 mb-4 mb-lg-0″> Person 2</div>
    <div class=”col-sm-6 col-lg-3 mb-4 mb-lg-0″> Person 3</div>
    –4th Person removed —
    </div>

    Thanks in advance!


    #10038682
    mooncave
    Participant

    Okay.. so I found a solution!
    I added “d-flex justify-content-center” to my line.

    So it looks like this: <div class=”row pb-5 mb-5 d-flex d-flex justify-content-center …>

    Is this okay or considered bad style? If there’s a better solution please let me know =)


    #10038695
    Support
    Keymaster

    Hello, sure, it’s correct, you can learn more about the columns alignments in this page: https://getbootstrap.com/docs/5.0/layout/columns/

    Let me know if there is anything else I can help you with.

    Kind Regards,

    Jonas


Viewing 3 posts - 1 through 3 (of 3 total)

This topic is marked as "RESOLVED" and can not rceive new replies.