保持按钮对齐,与文本长度无关

时间:2018-04-30 07:35:55

标签: bootstrap-4

如何保持按钮位置不受段落大小(可以是3行或4行)的影响?

html:

<div class='container'>
    <div class='row'>
            <div class='col-sm-4'>
                <div class='card-block'>
                    <img class='card-img-top' src='img/sun.png'>
                    <h2 class='card-title text-center'><a href='POST'>
                    TITLE</a></h2>
                    <p class='card-text preview'>POST PREVIEW</p>
                    <div class='text-center'>
                        <a class='btn btn-primary' href='POST'>Read More</a>
                    </div>
                </div>
            </div>
    </div>
</div>  

的CSS:

.col-sm-4 {
margin-bottom: 50px;
}

.card-img-top {
margin-bottom: 25px;
}

.preview {
text-align: justify;
}

截图:

enter image description here

0 个答案:

没有答案