Forums

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

Home Forums CSS Flex-box: how many items in one row?

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #246513
    Ayala
    Participant

    Can I define exactly how many items would be in one row?

    #246520
    Paulie_D
    Member

    Yes, by setting a percentage width (with wrapping enabled)….just like a grid system (which flexbox is not).

    Did you have a more specific requirement?

    #246538
    Ayala
    Participant

    Now I have 5 items in a row, but I want exactly 4, because I want bigger pictures.
    I think with percentage I can’t do this.

    http://codepen.io/Ayalann/pen/KgBqPG

    #246540
    Paulie_D
    Member

    What is supposed to happen to the fifth image?

    The answer is, of course, to wrap each link in it’s own div with a width of 25%…but I suspect that’s going to break your layout.

    I think you would be better off looking into an actual grid system framework it’s seems to suit what you are trying to do.

    As for breaking a flex row…it is possible but it’s a tad hacky and not extendable – http://stackoverflow.com/questions/29732575/line-break-in-multi-line-flexbox

    #246552
    Ayala
    Participant

    http://codepen.io/Ayalann/pen/QKBYka

    The “page-break-after: always;” is work (what you liked) but only in firefox. But it would be perfect.

    Maybe the grid property also would be good (I haven’t used it before) but it seems it isn’t popular:
    http://caniuse.com/#search=grid

    I can’t use it.

    #246558
    Paulie_D
    Member

    I was referring to a grid framework like Bootstrap or Foundation not CSS Grids, the two are quite different.

    #246693
    Ayala
    Participant

    Okay, thank you!

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