how to bring the text and button on same line 这是代码:
<div class="col-sm-8">
<h4>Edit Post</h4>
<button type="button" class="btn btn-primary" style="display: inline-
block;">Add New</button>
</div>
答案 0 :(得分:3)
在标题上使用Bootstrap 4 d-inline-block
类...
<div class="col-sm-8">
<h4 class="d-inline-block">Edit Post</h4>
<button type="button" class="btn btn-primary">Add New</button>
</div>
(可选)使用align-middle
与按钮垂直对齐。