小型设备中的Bootstrap 4 Grid问题

很棒的设计师

我的代码如下

<div class="row align-items-center">
  <div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12">
    One of three columns
  </div>
  <div class="col-12 col-xl-6 col-lg-6 col-md-12 col-sm-12">
   One of three columns
  </div>
</div>

CSS如下所示

.row {
    height: calc(70vh - 60px);
}

当我签入移动设备或小型设备网格项目时,请在上部和下部放置一些空间。屏幕截图如下在此处输入图片说明

你可以看到空间。我想使div没有空间。我怎么能够?

华西

<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet"/>

<div style="height: 200px;background-color: sandybrown;" class="d-flex align-items-center justify-content-center">
    <div class="row no-gutters d-flex bg-primary">
      <div class="col-12 col-md-6 bg-info">on small 12-cols and medium or above 6-cols</div>
      <div class="col-12 col-md-6 bg-warning">on small 12-cols and medium or above 6-cols</div>
    </div>
</div>

如果您不希望在空白屏幕上进行边距填充或边距填充,则可以media queryscss

@media (max-width: 576px) { 
      margin: 0px; padding: 0px 
}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章