sass - 如何解决在 div 中间设置滑动器位置的问题
问题描述
我正在尝试在 div 容器的中间设置 swiper,看起来它仅适用于 iphone 5 宽度。我为此设置了一个班级,但它不起作用。谁能向我解释如何解决它?
.html 文件
<swiper class="align-middle" #swiper [config]="swiperconfig">
<ng-container *ngFor="let item of data;">
<div class="swiper-slide align-middle" >
<app-ds-widget-component #card [item]="item" [totalFlow]="data.totalFlow"></app-ds-widget-component>
</div>
</ng-container>
</swiper>
</div>
.scss 文件
@media (min-width: 570px) and (max-width: 1024px){
.swiper-view {
justify-content: center;
margin-left: auto;
margin-right: auto;
}
}
@media only screen
and (min-device-width : 320px)
and (max-device-width : 568px) {
.swiper-view {
justify-content: center;
margin-left: auto;
margin-right: auto;
}
}
解决方案
推荐阅读
- c++ - libjpeg 和 libpng 中的这些属性是什么?
- css - CSS Grid 自动宽度不适用于 SVG
- regex - 在 Nginx sub_filter 中使用正则表达式
- r - R中的合并和总计行
- excel - Excel 中的持续时间总和,带小数秒
- javascript - 如果我不能使用 return 退出 for...in 循环,我可以使用什么?
- nginx - 覆盖 http{} 中的 nginx.conf 选项 keepalive_timeout 保留默认的 nginx.conf 文件
- tensorflow - 在 TFLite v2.3 for ARM64 中启用 XNNPack
- google-chrome - 关闭浏览器时如何强制 Chrome 结束 Flask 中的会话?
- r - 如何在 R 中仅使用 lat、long 绘制地图而没有分组