Two Divs next to each other, that then stack with responsive change

前端 未结 6 865
感情败类
感情败类 2020-11-28 02:17

I\'m trying to achieve something that I am sure should be easier than I am making it!

I am using the Skeleton responsive framework, and have been fine up until now.<

6条回答
  •  猫巷女王i
    2020-11-28 02:54

    today this kind of thing can be done by using display:flex;

    https://jsfiddle.net/suunyz3e/1435/

    html:

      
    Div One
    Div Two

    css:

    .container{
      display:inline-flex;
      flex-wrap:wrap;
      border:1px solid black;
    }
    .flex-direction{
      flex-direction:row;
    }
    .div1{
      border-right:1px solid black;
      background-color:#727272;
      width:165px;
      height:132px;
    }
    
    .div2{
      background-color:#fff;
      width:314px;
      height:132px;
    }
    
    span{
      font-size:16px;
        font-weight:bold;
        display: block;
        line-height: 132px;
        text-align: center;
    }
    
    @media screen and (max-width: 500px) {
      .flex-direction{
      flex-direction:column;
      }
    .div1{
      width:202px;
      height:131px;
      border-right:none;
      border-bottom:1px solid black;
      }
      .div2{
        width:202px;
        height:107px;
      }
      .div2 span{
        line-height:107px;
      }
    
    }
    

提交回复
热议问题