Change order of floated divs with CSS

后端 未结 4 426
孤城傲影
孤城傲影 2020-12-16 15:07

JSFIDDLE

I want to change the order of floated divs at a certain pixel size.

At default state they both have 50% width and they are next to

4条回答
  •  隐瞒了意图╮
    2020-12-16 15:34

    Try to change your

    HTML to this -

    and your @media query CSS to this -

    @media screen and (max-width:600px) {
    .container{
        display:flex;
        flex-direction: column-reverse;
    }
    .yellow {
        background: yellow;
        width: 100%;
        height: 300px;
    
    }
    
    .red {
        background: red;
        width: 100%;
        height: 300px;
    
    
    } }
    

提交回复
热议问题