put n-divs next to each others on large screens and one below each others on small screens

前端 未结 3 1101
名媛妹妹
名媛妹妹 2021-01-25 23:21

I am struggling to achieve this efect ;

I would like to put n-divs next to each others if the screen is big enough , and one below each other otherwise , and I would li

3条回答
  •  说谎
    说谎 (楼主)
    2021-01-25 23:56

    You can achieve this using media query.I have used 400px as the break point you can use as per your choice.Here is a working JSfiddle link https://jsfiddle.net/0f5y8q8b/

    @media only screen and (min-width: 400px) {
        .homepage-top-category-container-item{
            width: 100%
        }
        .homepage-top-category-container-list{
          display:block
        }
    

    }

提交回复
热议问题