2016-02-25 26 views
0

對不起,如果我的問題看起來很奇怪,我很難找到一個很好的方法來問這個問題。 我目前正試圖把你的HTML圖像,但我不知道是否有可能設置一列(或幾個div),所以這是他們對齊,但然後當我切換到一個移動設備上,列(或幾個div)出現在結尾處而不是左側的div之間。我做了一些嘗試,但沒有很好的表現了,再加上我真的不使用Twitter的引導是否可以確定哪個div首先出現在移動版本上?

預先感謝您

On left, the desktop version, on right, the mobile version

+0

一個http://jsfiddle.net/,將不勝感激。你可以嘗試顯示:table display-table-row ...就像這個例子http://snook.ca/archives/html_and_css/getting_your_di – lastboy

+0

另一種選擇就像在這篇文章中一樣http://stackoverflow.com/questions/ 7693224/how-do-i-right-align-div-elements – lastboy

回答

1

這是我使用Twitter的Bootstrap的方法。瀏覽器從上到下讀取頁面。因此,在調整瀏覽器大小後使用這種安排,可能會讓右側的列進入前兩列和最後兩列。希望這會有所幫助。

<div class="container"> 
    <div class="col-md-8"> 
     <div class="thumbnail">Col 1</div> 
     <div class="thumbnail">Col 2</div> 
    </div> 
    <div class="navbar-right col-md-4 thumbnail"> 
     Long Column<br> 
     Long Column<br> 
     Long Column<br> 
     Long Column<br> 
     Long Column<br> 
     Long Column<br> 
    </div> 
    <div class="col-md-8"> 
     <div class="thumbnail">Col 3</div> 
     <div class="thumbnail">Col 4</div> 
    </div> 
</div> 
+0

我改編了你的解決方案,它工作得很好,謝謝! – Jaeger

+0

歡迎您 –

1

您可以嘗試將div放在容器的左側

相關問題