我正在尝试让列占用剩余空间而不是等待列的结尾。在col-lg-6中使用两个div的最佳方法是什么,并将div设置在col-lg-12中?只是想确保我正确使用bootstrap并尽早摆脱任何不良习惯。它会更容易在图片中显示
答案 0 :(得分:1)
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-md-6" style="border:1px solid #777777;">
<div class="row">
<div class="col-md-12" style="border:1px solid #777777;height:100px;">
</div>
<div class="col-md-12" style="border:1px solid #777777;height:140px;">
</div>
</div>
</div>
<div class="col-md-6" style="border:1px solid #777777;">
<div class="row">
<div class="col-md-12" style="border:1px solid #777777;height:150px;">
</div>
<div class="col-md-12" style="border:1px solid #777777;height:100px;">
</div>
</div>
</div>
</div>
</div>
</body>
</html>