Quantcast
Channel: Active questions tagged flexbox - Stack Overflow
Viewing all articles
Browse latest Browse all 1453

CSS Flexbox justify-content Space Between Only Some Items? [duplicate]

$
0
0

I have a div where I want to apply justify-content: space-between but have the first 2 or last 2 (or whatever combination I need) of items "stick together".

For example if I have a Navigation menu, the menu will obviously be wider than icons I want to put in the same div. So if that div has 4 items, Nav and 3 social media icons, and I apply space-between, those icons sort of float in the middle on the right side. I want them to be grouped to the right and that space between the wider nav and the grouping of 3 icons flow nice. I don't want to do this by putting them in yet another div. Is this possible? Is there a style I can add to the 3 icons I want on the right?

https://css-tricks.com/almanac/properties/j/justify-content/

In this case, I would want the green boxes to be [1][2] . . . [3][4][5] if that makes sense.


Viewing all articles
Browse latest Browse all 1453

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>