You need to apply the flex properties to the <ul>
ul {
display: flex;
flex-direction: row; <-- not needed as this is the default behavior
flex-wrap: wrap;
}
Putting the properties on the <div>
tells it to display the <ul>
in flex, not <li>
.
Related Contents:
- In CSS Flexbox, why are there no “justify-items” and “justify-self” properties?
- Flex-box: Align last row to grid
- Vertical Align Center in Bootstrap 4 [duplicate]
- Bootstrap align navbar items to the right
- How to justify a single flexbox item (override justify-content) [duplicate]
- How can I align one item right with flexbox?
- What are the differences between flex-basis and width?
- Scrolling a flexbox with overflowing content
- React native text going off my screen, refusing to wrap. What to do?
- How to stretch children to fill cross-axis?
- Prevent flex items from overflowing a container
- Text in a flex container doesn’t wrap in IE11
- margin-top only when the flex item is wrapped
- Flexbox: how to get divs to fill up 100% of the container width without wrapping?
- CSS3 Flexbox: display: box vs. flexbox vs. flex
- How do I set a flex-container to be the width of its flex-items?
- First-child full-width in Flexbox
- Height 100% on flexbox column child [duplicate]
- Make an item stick to the bottom using flex in react-native
- Simulate display: inline in React Native
- How does flex-wrap work with align-self, align-items and align-content?
- css grid of squares with flexbox
- Flexbox column align self to bottom
- How to keep wrapped flex-items the same width as the elements on the previous row?
- Specifing width of a flexbox flex item: width or basis? [duplicate]
- Padding-bottom/top in flexbox layout
- Image stretching in flexbox in Safari
- Difference between flex-end and end?
- Make flex element ignore child element
- Enabling horizontal scroll in flexbox
- Is it possible to animate Flexbox inserts & removes?
- Issue when centering vertically with flexbox when heights are unknown
- How do I set distance between flexbox items?
- CSS flexbox vertically/horizontally center image WITHOUT explicitely defining parent height
- How do I use “flex-flow: column wrap”?
- Do I not understand the flex-grow property?
- How to fill the height of the viewport with tailwind css
- How can I create multi columns from a single unordered list?
- Flexbox: flex-start/flex-end, self-start/self-end, and start/end; What’s the difference?
- flexbox space-between and align right
- Using margin on flex items
- How to use Bootstrap 4 flexbox to fill available content?
- How to control number of items per row using media queries in Flexbox?
- How can I get FF 33.x Flexbox behavior in FF 34.x? [duplicate]
- How to use flex-grow?
- Flex auto margin not working in IE10/11
- Every item to have the same width as the widest element [duplicate]
- Bootstrap 4 navbar with 2 rows
- flexbox misbehaving with max-height
- How does flex-shrink factor in padding and border-box?