如何自定义Bootstrap网格高度?

时间:2017-07-25 16:53:33

标签: html css twitter-bootstrap

为什么这个Bootstrap网格的高度为591.067? 这个高度来自哪里?



.main-post {
    padding: 20px;
    background-color: #FFF;
    border: 1px solid #D8D8D8;
    margin-bottom: 100px;
}

.main-post .post-categories {
    margin-bottom: 10px
}

.main-post h3 {
    margin: 0 0 10px;
    color: #777;
    letter-spacing: -1px;
    font-weight: bold
}

.main-post .post-author,
.main-post .post-date,
.main-post .post-comments {
    font-size: 12px
}

.main-post img {
    display: block;
    margin: 10px 0;
}

.main-post .post-summary {
    line-height: 1.7;
    color: #888
}

.main-post i {
    color: #999
}

                <div class="col-sm-6">
                    <div class="main-post">
                        <h3 class="post-title">
                            <a href="#">
                                Post Title
                            </a>
                        </h3>
                        <span class="post-author">
                          <i class="fa fa-user fa-fw"></i>
                          Etsh
                        </span>
                        <span class="post-date">
                        <i class="fa fa-calendar fa-fw"></i>
                          07/2017
                        </span>
                        <span class="post-comments"><i class="fa fa-comments  fa-fw"></i>
                            No comments
                        </span>
                       <img src="http://www.placehold.it/300x300">
                        <p class="post-summary">
                            Test...
                        </p>
                        <hr>
                        <div class="post-categories">
                            <i class="fa fa-tags fa-fw"></i>
                            Categories
                        </div>
                        <p class="post-tags">
                            Tags
                        </p>
                    </div>
                </div>
                
&#13;
&#13;
&#13;

正如您在图片中看到的,我无法获得&#34; Prev&#34;和&#34;下一步&#34;由于这个高度,帖子下方的按钮。

截图:

enter image description here

1 个答案:

答案 0 :(得分:0)

您的.mainpostmargin-bottom: 100px

这可能是罪魁祸首。删除它,看看会发生什么。您可能需要找到一种不同的方式来发布帖子。 (搜索flexbox)虽然没有更清晰的例子,但很难说。