html - 如何在大屏幕上的 Bootstrap 中堆叠两列

标签 html css twitter-bootstrap

我正在使用 Bootstrap 框架为网站设计网格布局。我想要一个网格,显示 2 个跨越 col-lg-4 宽度的堆叠 div,旁边是一个跨越 col-lg-8 宽度且高度等于两个堆叠 div 的大 div。

<div class="mockups_wadels">
    <div class="div_center">
        <div class="container">
            <div class="row">
                <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 grid_padding">
                    <div class="wadels_dark">
                    </div>
                </div>
                <div class="col-lg-8 col-md-8 col-sm-8 col-xs-12 grid_padding">
                    <div class="wadels_embroidery">
                    </div>
                </div>
                <div class="col-lg-4 col-md-4 col-sm-6 col-xs-12 grid_padding">
                    <div class="wadels_white">
                    </div>
                </div>
            </div><!--end of row-->
            <div class="row">
                <div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
                    <div class="wadels_browser">
                    </div>
                </div>
            </div>
        </div><!--container end-->
    </div><!--end div center-->
</div><!--end of mockup-->

这里有一个 jsfiddle 来帮助说明。我的问题是我不知道如何强制两个 col-lg-4 div 相互堆叠。而不是堆叠第二个 div 只是开始一个新行。 http://jsfiddle.net/Dinkledine/0w2fppx6/

想要结果

desired result

谢谢你的帮助

最佳答案

这是我的面板和列布局解决方案。如果你需要填充,请从类中删除 nopadding

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> New Document </title>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
  <style type="text/css">
	.nopadding {
	   padding: 0 !important;
	   margin: 0 !important;
	}
  </style>
 </head>

 <body>
	<div class="container-fluid row-offcanvas nopadding">
			<div class="col-sm-5 nopadding">
				<!--Content 1-->
				<div class="col-sm-12 col-md-12 nopadding">		
					<div class="panel panel-default nopadding">
						<div class="panel-heading" style="background-color: lightblue; color: #000; font-weight:bold">content 1</div>
							<div class="panel-body" style="height:270px;overflow:auto;"></div> 			
						<div class="panel-footer" style="background-color: lightblue;"></div>
					</div>
				</div><!--Content 1 Ends-->

				<!--Content 2-->
				<div class="col-sm-12 col-md-12 nopadding" >
					<div class="panel panel-default nopadding">
						<div class="panel-heading" style="background-color: lightsteelblue; font-weight:bold">content 2</div>
							<div  class="panel-body" style="height:270px;overflow:auto;"></div> 
						<div class="panel-footer" style="background-color: lightsteelblue;"></div>
					</div>
				</div><!--Content 2 Ends-->
			</div>

			<div class="col-sm-7 nopadding">
				<!--Content 3 -->
				<div  class="col-sm-12 col-md-12 nopadding">   
					<div class="panel panel-default nopadding">
						<div class="panel-heading" style="background-color: lightsteelblue; font-weight:bold">Content 3</div>
							<div class="panel-body" style="height:602px;overflow:auto;"></div>
						<div class="panel-footer" style="background-color: lightsteelblue;"></div>
					</div>  
				</div><!--Content 3 Ends -->
		 </div>
	</div>	<!--row-->	
 </body>
</html>

关于html - 如何在大屏幕上的 Bootstrap 中堆叠两列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33041849/

相关文章:

html - css水平导航菜单创建了不必要的空白空间

css - GWT DataGrid -- CSS 边框不生效

html - Bootstrap v4-Alpha 6 | .float-lg-right 不工作

javascript - Bootstrap 模式不显示内容

php - HTML 表格在 phpmail 函数中不对齐

c# - 为什么此按钮在 ASP.NET MVC CSS 中显示在表格上方而不是下方

css - 如何在图像上重叠菜单列表

css - 将 CSS3 线性渐变应用于跨度文本

css - 如何显示 Bootstrap 输入日期字段的完整字段?

html - DIV 重叠粘性页脚