html - Bootstrap 中卡片的间距问题

标签 html css angularjs twitter-bootstrap

我正在尝试使用卡片创建一个简单的网格。我正在使用 ng-repeat 创建卡片。问题是每张卡片之间没有间距,如图所示

enter image description here

我正在使用下面的代码

<!DOCTYPE html>
<html lang="en" ng-app="movieflix">
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div class="container" ng-controller="catalogcontroller">
    <div class="row" >

        <div  dir-paginate="user in users|itemsPerPage:16">

          <div class="col-xs-6  col-sm-3 col-md-3">
            <div class="card card-block ">
              <!--Card image-->
              <div class="view overlay hm-white-slight">
                <img src="http://ia.media-imdb.com/images/M/MV5BMTU4MDU3NDQ5Ml5BMl5BanBnXkFtZTgwOTU5MDUxNTE@._V1_SX300.jpg", class="img-fluid" alt="">
                <a>
                  <div class="mask waves-effect waves-light"></div>
                </a>
              </div>
              <!--/.Card image-->
              <!--Card content-->
              <div class="card-block">
                <!--Social shares button-->
                <!--Title-->
                <h4 class="card-title">Card title</h4>
                <hr>
                <!--Text-->
                <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p>
                <a href="#" class="d-flex flex-row-reverse">
                  <h5 class="waves-effect waves-light p-2">Read more <i class="fa fa-chevron-right"></i>
                  </h5>
                </a>
              </div>
              <!--/.Card content-->
            </div>
          </div>

        </div>
      </div>
    <dir-pagination-controls
            max-size="5"
            direction-links="false"
            boundary-links="false" >
    </dir-pagination-controls>

</div>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.min.js"></script>

<script src="js/dirPagination.js"></script>
<script src="js/movieflix.module.js"></script>
<script src="js/catalog.controller.js"></script>
</body>
</html>

谁能告诉我我的代码有什么问题。

非常感谢任何建议。

提前致谢

最佳答案

card 类工作得很好。你的图片太宽了。将您的图像类从 img-fluid 更改为 img-responsive 它应该可以工作。 至少在 this fiddle 上是这样的.

关于html - Bootstrap 中卡片的间距问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43333362/

相关文章:

javascript - 彩盒 - 外部链接

javascript - object.push(array) 不起作用

html - 如何在多个文件中重复使用同一段 HTML/CSS?

html - CSS 悬停事件,如何触发 parent 的影响

javascript - 使用 css 将一个 div 悬停在另一个不透明的 div 上

php - 评论系统 CSS 文本开箱即用

javascript - 更新 .then 内的 $scope 吗?

javascript - 使用 $resource 时 Protractor 超时等待与页面同步

css - 如何将任何 div 高度从中间拉伸(stretch)到浏览器窗口的末尾

html - 从 anchor 内的跨度中删除下划线