列没有保证金

时间:2018-07-18 09:50:36

标签: html css twitter-bootstrap

我正在使用Bootstrap 3.3.7。我不明白为什么我的较小列无法与较大列保持边距。 See the demo here

两列之间有transform(DATA, Col.B = ifelse( tolower(Col.A) %in% c("yes", "no"), as.character(Col.B), as.character(Col.A))) 的边距。

Fx。第一行包含以下列:10px-600x410px 600x200px

所以300x200px。因此,我将大列的高度设置为200px + 200px + 10px margin = 410 height

为什么它们不对齐?

410px
/* Card and Button */

    body {
        background-color: #f5f5f5;
    }
    div { 
        background-color: #fff;
    }
    .index-content a:hover {
      color: black;
      text-decoration: none;
    }

    .index-content {
      /*margin-bottom: 20px;*/
      /*padding: 50px 0px;*/
    }

    .index-content .row {
      margin-top: 20px;
    }

    .index-content a {
      color: black;
    }

    .index-content .card {
      background-color: #FFFFFF;
      padding: 0;
      -webkit-border-radius: 4px;
      -moz-border-radius: 4px;
      border-radius: 4px;
      box-shadow: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
    }

    .index-content .card:hover {
      box-shadow: 0 16px 24px 2px rgba(0, 0, 0, 0.14), 0 6px 30px 5px rgba(0, 0, 0, 0.12), 0 8px 10px -5px rgba(0, 0, 0, 0.3);
      color: black;
    }

    .index-content .card img {
      width: 100%;
      border-top-left-radius: 4px;
      border-top-right-radius: 4px;
      height: 350px;
    }

    .index-content .card h4 {
      margin: 20px;
    }

    .index-content .card p {
      margin: 20px;
      opacity: 0.65;
    }

    .index-content .blue-button {
      width: 100px;
      -webkit-transition: background-color 1s, color 1s;
      /* For Safari 3.1 to 6.0 */
      transition: background-color 0.5s, color 0.5s;
      min-height: 20px;
      background-color: #002E5B;
      color: #ffffff;
      border-radius: 4px;
      text-align: center;
      font-weight: lighter;
      margin: 0px 20px 15px 20px;
      padding: 5px 0px;
      display: inline-block;
    }

    .index-content .blue-button:hover {
      background-color: #dadada;
      color: #002E5B;
    }

    /* GRID ELEMENTS MEDIA QUERIES */

    
    @media (min-width: 768px) {
        .card {
            position: relative;
        }
        .card-content {
            position: absolute;
            bottom: 0;
            width: 100%;
            background: rgba(0, 0, 0, 0.5);
        }
        .card-content h4,
        .card-content p {
            color: white;
            width: 100%;
            float: left;
            margin: 0 0 5px;
        }
        .card-content a {
            float: right;
        }
        .index-content .card h4,
        .index-content .card p {
            padding: 15px 20px;
            margin: 0;
        }
        .index-content .card p {
            padding: 0 20px 15px;
            margin: 0;
        }
    }

    .margin_bottom{
        margin-bottom:10px;
    }
    .row [class*="col-"]{ 
        padding-right: 5px;
        padding-left: 5px; 
    }
    .row { 
        margin-left: -5px; 
        margin-right: -5px; 
    }
    
    .card-img-bottom {
  color: #fff;
  height: 20rem;
  background: url(images/img1.jpg) center no-repeat;
  background-size: cover;
}
.img-responsive {width:100%;}

1 个答案:

答案 0 :(得分:1)

设置dependencies { def withoutSupportAnnotations = {exclude group: 'com.android.support', module: 'support-annotations'} androidTestImplementation 'com.android.support.test:runner:1.0.2', withoutSupportAnnotations androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2', withoutSupportAnnotations} 而不是.img-responsive { height: 100%; }。请检查以下工作示例。希望对您有帮助:)

,并根据较小屏幕中的建议设置宽度:.img-responsive {width:100%; }

@media (max-width: 768px) { .img-responsive { width: 100%; } }