T
T
test-cats2019-10-25 08:31:10
Layout
test-cats, 2019-10-25 08:31:10

How to move an element to a new line using flexbox?

There is a list. The elements of the list contain some elements. How to use flexbox so that when the monitor screen is reduced, the elements adapt to the screen?

<ul>
   <li>1</li>
    <li>2</li>
    <li>3</li>
</ul>

ul {
display:flex;
}
ul li {
background: red;
text-decoration: none;
align-items: center;
}

Thanks to all

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew, 2019-10-25
@test-cats

ul {
display:flex;
flex-wrap:wrap;
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question