2017-10-09 115 views
1

我試圖上傳和映像,但由於某種原因,它無法正常工作。Bootstrap列在響應時向左移動

基本上,我在​​有超長鏈接列表,所以有三列。在PC和筆記本電腦上,它看起來非常好,但是當使用手機進行響應時,所有鏈接都會直接進入屏幕的左側。

如何在響應時將它們設置爲中央?

感謝您的時間

+0

顯示你的代碼,請 – Thielicious

+1

有3個班,'COL-MD-4'的屏幕中,用於大屏幕的'col-lg-4',以及用於小屏幕的手機'col-xs-4'。您必須添加與手機屏幕大小相對應的類。 – F0XS

+0

@FoxCy,所以在我的情況下 - 這是否意味着它將是div class =「col-xs-12 col-md-4」,因爲我想在移動設備上顯示一列...但在桌面上顯示3列? – Matt1966

回答

0

請參閱下面的代碼:

<!-- Stack the columns on mobile by making one full-width and the other half-width --> 
 
<div class="row"> 
 
    <div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div> 
 
    <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> 
 
</div> 
 

 
<!-- Columns start at 50% wide on mobile and bump up to 33.3% wide on desktop --> 
 
<div class="row"> 
 
    <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> 
 
    <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> 
 
    <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div> 
 
</div> 
 

 
<!-- Columns are always 50% wide, on mobile and desktop --> 
 
<div class="row"> 
 
    <div class="col-xs-6">.col-xs-6</div> 
 
    <div class="col-xs-6">.col-xs-6</div> 
 
</div>