2x2 Box beside 1 big 2x2 size box using css

前端 未结 5 1029
傲寒
傲寒 2021-01-21 02:42

Is it possible to make like on a ul li structure with flexbox? I tried making the squares width set on 25% and the 1st, 3rd or the 5th one to 50% width with a trick of

5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-21 03:10

    U dont need flex.

    #test {
      list-style:none;
      width:100%;
    }
      .item1{
        width:50%;
        float:left;
        height:300px;
        background-color:red;
      }
    .item {
      width:25%;
      float:left;
      background-color: #444;
      height:150px;
    }
    

    https://jsfiddle.net/rL7rqp1r/3/

提交回复
热议问题