How can I reorder my divs using only CSS?

后端 未结 24 1128
傲寒
傲寒 2020-11-22 01:53

Given a template where the HTML cannot be modified because of other requirements, how is it possible to display (rearrange) a div above another div

24条回答
  •  甜味超标
    2020-11-22 02:00

    If you just use css, you can use flex.

    .price {
        display: flex;
        align-items: center;
        justify-content: center;
    
        flex-direction: row-reverse; //revert horizontally
        //flex-direction: column-reverse; revert vertically
    }
    first block
    second block

提交回复
热议问题