两个div之间出现无法解释的差距

时间:2016-04-25 00:54:34

标签: html css twitter-bootstrap twitter-bootstrap-3

我在两个div之间出现了无法解释的差距。

以下是情况的图片:

enter image description here

正是我想要消失的红色div之上的差距。

我希望红色div一直到red一直到图像所在的位置。我怎么能这样做?

代码:

<script type="text/html" id="product-template">
    <div class="col-sm-6 col-lg-2 clickable" style="margin-top:20px; padding: 25px;">
        <div style="border-radius: 10px; border: 1px solid white;height: 270px;overflow: hidden;">
            <div style= "height: 200px; border: 1px solid white; 
                        border-top-left-radius: 10px; 
                        border-top-right-radius: 10px;
                        color: white; 
                        background: center no-repeat;
                        background-image: url(../../the_vegan_repository/product_images/alpro_custard.jpg);
                        background-size:cover;">
            </div>
            <div style="height: 70px; background: red;">
                <h6 data-bind="text: product.name" style="color: white"></h6>
                <h6 data-bind="text: shop.name" style="color: white"></h6>
                <h6 data-bind="text: shop.suburb" style="color: white"></h6>
            </div>
        </div>
    </div>
</script>

1 个答案:

答案 0 :(得分:2)

您有一个0孩子的底部h6,并且在引导程序中,divh1的标题有h6margin-top:10px &#34;默认情况下&#34;因此您需要重置margin-bottom:10px中的margin

类似的东西:

h6
相关问题