Bootstrap:将一个 div 与另外两个相邻 [英] Bootstrap: Place one div next to two others
问题描述
我最近开始使用 Twitter 的 Bootstrap.
如何在 两个 其他 div(#1 和 #2)旁边放置一个 div(#3),以便右侧的 div 与垂直的其他两个 div 一样高/大.
到目前为止我的代码:
<div class="form-group col-md-8"><label for="1">1</label><input type="text" id="1" class="form-control" placeholder="1"><div class="form-group col-md-8"><label for="2">2</label><textarea id="2" class="form-control" rows="10"></textarea>
<div class="col-md-4"><img src="http://placehold.it/250x250&text=Map"/><input type="text" id="geo" class="form-control" placeholder="3">
我在这里开始了一个小提琴:http://jsfiddle.net/2cbuL/6/
有一种更语义化的方式来做到这一点(仅在我发现这个问题寻找解决方案时才发布这个)
首先您需要了解网格系统的基础知识,然后实现非常简单,只需在一行中设置两个彼此相邻的 div,然后在其中一个 div 中包含两个 div 的行.示例:
<div class="row"><div class="col-lg-6"><div class="col-lg-6"><div class="row"><div class="col-lg-12">