How to get columns to break into rows with flexbox?

后端 未结 2 1538
我寻月下人不归
我寻月下人不归 2021-01-25 00:18

I have this form with four input elements in a row (in desktop view).

Can anybody tell me how to get those four input elements to break into rows when the screen width g

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-25 00:33

    Use a media query with a breakpoint of 680px and flex-direction:column;

    form {
      display: flex;
    }
    @media screen and (max-width: 680px) {
      form {
        flex-direction: column;
      }
    }

提交回复
热议问题