2017-10-08 74 views
1

有人可以解釋我如何使用引導程序4測試版將文本標題與button對齊,我相信這example不起作用,因爲pull-left已更改。對齊按鈕與文本標題引導4測試版

我在使用float-left當我嘗試對齊它們時,但按鈕並不是它應該在的位置,所以標題應該在左邊,在同一行右邊的按鈕,這裏是我的JSFIDDLE,所以可以有人向我解釋說,用新的bootstrap 4測試版來實現這個目標。

<div class="row justify-content-center"> 
    <div class="col-6"> 
     <h5><strong>BLOG TITLE GOES HERE</strong></h5> 
     <div class="float-right"> 
     <button type="button" class="btn btn-outline-secondary">Read more</button> 
     </div> 
     <p class="blockquote-footer text-primary">By Branko Milosevic</p> 
     <p>22.08.2017</p> 
     Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. 
    </div> 
    </div> 
+0

我提供** **的jsfiddle例如:P – PetarP

+0

這裏我們對此深感抱歉,並** **的jsfiddle是罰款。 – PetarP

回答

1
<div class="row justify-content-center"> 
    <div class="col-6"> 
     <div class="foo"> 
      <h5><strong>BLOG TITLE GOES HERE</strong></h5> 
      <div class="float-right"> 
       <button type="button" class="btn btn-outline-secondary">Secondary</button> 
      </div> 
     </div> 
     <p class="blockquote-footer text-primary">By Petar Pilipovic</p> 
     <p>22.08.2017</p> 
     Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS. 
    </div> 
</div> 

<style> 
.foo { display: flex; justify-content: space-between; } 
</style> 

https://jsfiddle.net/a6frvp9d/1/

+0

改爲'.foo',你可以使用內建類:'d-flex justify-content-between'。 https://jsfiddle.net/a6frvp9d/4/請參閱:https://v4-alpha.getbootstrap.com/utilities/flexbox/ –

+0

@ G-Cyr我從來沒有使用Twitter Bootstrap,不熟悉它的內置類) –