Posts

Showing posts with the label Flexbox

Controlling The Amount Of Space In Justify-content: Space-between

Answer : The justify-content property uses the available space on the line to position flex items. With justify-content: space-between , all available space is placed between the first and last items, pushing both items to opposite edges of the container. You wrote: I was wondering how to justify how much space is allowed in justify-content: space-between for flexbox. With space-between in row-direction, you would have to control the width of the flex container. So if you want there to be less space between flex items, then you would need to shorten the width of the container. Or you could use justify-content: space-around . However, these solutions are suboptimal. The right way to go about this would be to use margins. You wrote: Currently, my items are spaced but they have way too much space between them I want just a little space between them so they can settle somewhere in the middle in a row. Use justify-content: center then use margins to space them apart. I find mysel...