<div class="container" style="background-color: red">
<div class="row">
<div class="col-xs-6" style="background-color: green; height: 100%">
<img src="http://www.unixstickers.com/image/data/stickers/jsfiddle/JSfiddle-blue-w-type.sh.png" class="img-responsive img-circle center-block" style="width: 20px">
</div>
<div class="col-xs-6" style="background-color: blue">
22222222222 <br />
22222222222 <br />
22222222222 <br />
22222222222 <br />
22222222222 <br />
22222222222 <br />
22222222222 <br />
</div>
</div>
</div>实例:https://jsfiddle.net/t814cmts/
如何为div.row中的第一个div设置100%的高度?为什么身高:100%不工作?我知道-我可以设置高度与px,但我的网站必须响应,我不想设置px的所有设备。
我想要100%的高度,因为我想把图像放在右边的文本中间。
发布于 2016-01-06 18:34:54
您希望左侧div中的图像居中至包含文本的右div。那么,即使你的内容div在高度增加,你的图像在左div应该是垂直中心?我尝试了这个匹配高度javascript匹配高度相邻的元素,看看http://brm.io/jquery-match-height-demo/网址
https://stackoverflow.com/questions/34640083
复制相似问题