Two images side by side and responsive

前端 未结 3 1744
没有蜡笔的小新
没有蜡笔的小新 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:44

    Thanks for the help, but I'm doing it with a different solution now, whicha friend suggested:

    #outer {
      position: relative;
      width: 50%;
      height: 0;
      margin: 30px auto 0 auto;
      padding-top: 25%;
      background-color: #999;
    }
        
    .itemwrapper {
      position: absolute;
      width: 50%;
      height: 100%;
      top: 0;
    }
        
    .item2 {
      left: 50%;
    }
    
    #outer img {
      height: 100%;
      max-width: 100%;
    }
    bag
    pen

    This evokes another problem though. The images arent filling the itemwrappers. I think i need to write some js for this :S.

提交回复
热议问题