Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS Challenges in FLEX

  • This topic is empty.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #266379
    yoyo
    Participant

    Guys

    I’m learning flex. have faced the below challenges in creating a directory kind of page.

    i have set the width for each persons i.e flex items as 100px and justify-content:space-between. when there is only 5 or 6 flex items it is aligned neat with a good space between them. when more flex-items are added they adjust themselves and the margin between them is very less.

    yes we can add margin-right to flex-item but i want to occupy the full space and i am too much tired of writing nth-child styles to cut down last elements margin in every row.

    and i want to align the remaining flex-items at the start or centre not the space between them. here is codepen.

    Thanks in advance.

    #266380
    Paulie_D
    Member

    There’s no easy /dynamic way to do that with flexbox…

    Here’s some research reading for you.

    https://stackoverflow.com/questions/42176419/targeting-flex-items-on-the-last-row

    Frankly, this is what CSS-GRID was written for.

    #266383
    yoyo
    Participant

    Thanks Paulie.

    will look into it.

Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘CSS’ is closed to new topics and replies.