2014-01-08 32 views
0

我正在使用bootstrap。我想擁有設備尺寸的全屏尺寸圖像。 從那裏兩個分區一個是左側(.container)和另一個是右側(.other)如何將垂直居中的div放在bootsrap中,父母與身體和html的高度爲100%

如何垂直居中。

HTML

<div class="row own-main-container"> 
<div class="col-sm-6 col-md-6"> 
<div class="container"> 
    <div class="child">Hello</div> 
</div> 
</div> 
<div class="col-sm-6 col-md-6"> 
<div class="other"> 
    HIHIHIHIHI 
</div> 
</div> 
</div> 

JSFIDDLE注意:調整窗口並排

同時看到浮動端已經發佈一個問題,但目前還不清楚。

感謝

+0

有沒有運氣看到的div浮動並排側小提琴。 – Anup

+0

嘗試通過拉左輸出到左側站點來調整大小 – sun

+0

我將其拖動到左側..! – Anup

回答

0

這裏你的兩個格垂直居中: http://jsfiddle.net/9YAWj/

中庸之道使用:

.container,.other{ 
    height:20px; 
    margin-top: calc(50% - 20px); 
    background-color:white; 
} 
相關問題