Displaying dynamically created lists in different columns

后端 未结 3 769
礼貌的吻别
礼貌的吻别 2021-01-28 13:09

I have some list of vendors in my site, those vendors list are created manually.

Live Site

Those links are displaying in one single column div

3条回答
  •  醉酒成梦
    2021-01-28 14:01

    Add display property:

    .vendor-list-item {
      display: inline-block;
      width: 33%;
    }
    

    For mobile, use media queries:

    @media (max-width: 480px){
      .vendor-list-item {
         width: 100%;
         text-align: center;
       }
    }
    

    You could also add a condition for tablets (<767px) to show in 2 columns (width: 50%).

    Info about media queries: https://developer.mozilla.org/es/docs/CSS/Media_queries

    Results

提交回复
热议问题