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

How to add justify-content:space between only to 2nd and 3rd child

Is it possible to add justify-content: space-between only to 2nd and 3rd child of a div?
I don’t want to make another parent around them, because that will broke my previous style.
I need to have structure like this:

.wrapper{
     display: flex;
}
<div class="wrapper">
    <div class="container-1">content 1</div>
    <div class="container-2">content 2</div>
    <!-- add space here -->
    <div class="container-3">content 3</div>
</div>

And my final result needs to look like this:

enter image description here

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

Maybe using nth child or something like that?

>Solution :

.container-3 {
     margin-left: auto;
}

This css will push your container-3 to the right and add available space in between

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