如何在bootsrap中垂直居中一个div,哪个父级是100%高度的body和html

如何在bootsrap中垂直居中一个div,哪个父级是100%高度的body和html,html,css,twitter-bootstrap,Html,Css,Twitter Bootstrap,我正在使用引导。我想有全屏大小的设备大小的图像。 从这两个分区开始,一个是左侧(.container),另一个是右侧(.other) 如何将上面的内容垂直居中 HTML <div class="row own-main-container"> <div class="col-sm-6 col-md-6"> <div class="container"> <div class="child">Hello</div> </d

我正在使用引导。我想有全屏大小的设备大小的图像。 从这两个分区开始,一个是左侧(.container),另一个是右侧(.other)

如何将上面的内容垂直居中

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>

你好
嗨嗨
注意:调整窗口大小以查看两个并排浮动的窗口

已经发布了一个问题,但不清楚


谢谢这里您的两个div垂直居中:

仅使用:

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

看到div在小提琴中并排浮动时运气不佳。请尝试通过将输出的左栏拉到左侧位置来调整大小。我将其拖到了最左侧。。!检查这个链接哦…明白了…我的网络有一些安全问题。!