html - 在 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>
解决方案
div {
display: flex!important;
align-items: center;
outline: none;
height: 100%;
max-height: 100%;
img{
margin: 0 auto;
width: auto;
max-height: 65%;
}
}
它解决了我的问题&滑块不跳
推荐阅读
- c# - 如何正确允许多个任务访问数据库文件?
- neural-network - keras的plot_model中的顶部数字是什么意思?
- android - 在没有数据绑定的情况下实现 MVVM
- python - UDP视频流延迟 - OPENCV python
- html - 相互重叠时使图像在点击时出现在前面
- arrays - 在 gnuplot 中声明两个数组并相对于另一个绘制它们
- mongodb-.net-driver - 如何从 mongodb 获取特定的嵌入式数组并使用 mongodb c# 驱动程序将其附加到新文档中
- javascript - 我需要简单的逻辑帮助来添加从 ts 文件中的模板获取的数字
- csv - 如何将 csv 文件读入数组,并用另一个 csv 文件中的条目进行比较和替换?
- java - 如何将 a 到 z 转换为二进制