Two images side by side and responsive

前端 未结 3 1768
没有蜡笔的小新
没有蜡笔的小新 2021-01-12 13:20

I\'m trying to put two images side by side and make them responsive. The problem now is, that the second image wraps first and then reacts to the size of the browser. I want

3条回答
  •  抹茶落季
    2021-01-12 13:49

    if image are same size or same ratio, you may use flex , width and min-width to set a break point:

    #outer {
      width:70%;/* demo*/
      margin:auto;/* demo*/
      display:flex;
      flex-wrap:wrap;
    }
    #outer>div {flex:1;}
    #outer>div>img {
      width:100%;
      min-width:200px;/* demo*/
    }
    bag
    pen

    remove or reset to your needs the rules commented with demo.

提交回复
热议问题