Flex-basis property


is the flex-basis property is like setting a default width to an item? is there a flex-basis for the height of an item?


Yes, essentially, and (if the layout is horizontal) it overrides any width property that has been applied. This explanation is good (starts off full of jargon, but stay with it because the examples make it quite clear) - https://gedd.ski/post/the-difference-between-width-and-flex-basis/

You specify which way to lay flex items out (the default horizontal row or the vertical col). So no, there isn’t a separate declaration because it flex basis is one or the other, it’s going to refer to either width or height - this is the same with most flex properties (justify, align etc), they work along the current axis.

1 Like