首页 > 解决方案 > 在 div 块中居中 img (slick-slider)

问题描述

我有一个中心img问题div。我阅读并完成了有关居中对齐问题的所有答案。帮助我display: flex,但它让我slick-slider跳起来。3 屏幕看起来不错,下一个没有幻灯片的跳转 1 秒和下一个很好。你可以在我的网站上看到它。img我怎样才能在div没有flex和的情况下集中我的position: absolute?或者我怎么能在没有跳转滑块的情况下做到这一点?我希望伙计们,你能理解我的英语,并为这个简单的问题感到抱歉......

    div {
      display: flex!important;
      justify-content: center;
      align-items: center;
      outline: none;
      height: 100%;
      max-height: 100%;
      img{
        width: 50%;
      }
    }
    <div class="partners multiple-items">
         <div>
            <img src="img/logo-adata.png">
         </div>
    </div>

标签: htmlcssslick.js

解决方案


div {
  display: flex!important;
  align-items: center;
  outline: none;
  height: 100%;
  max-height: 100%;
  img{
    margin: 0 auto;
    width: auto;
    max-height: 65%;
  }
}

它解决了我的问题&滑块不跳


推荐阅读