Html 如何在引导中放置一个容器(两行)和两个容器(两个不同的行)?
如何在引导中放置一个容器(两行)和两个容器(两个不同的行)Html 如何在引导中放置一个容器(两行)和两个容器(两个不同的行)?,html,css,twitter-bootstrap,bootstrap-modal,Html,Css,Twitter Bootstrap,Bootstrap Modal,如何在引导中放置一个容器(两行)和两个容器(两个不同的行) 我希望容器按这种方式排列,你可以使用网格来做这类事情。 你能举例说明它应该是什么样子吗?(我可以帮你更多) 编辑: 为此,实际上只需要一行两列 它看起来是这样的: <div class="row"> <div class="col-md-8"> <!-- 8 is the width of the left side --> You content here
我希望容器按这种方式排列,你可以使用网格来做这类事情。 你能举例说明它应该是什么样子吗?(我可以帮你更多) 编辑: 为此,实际上只需要一行两列 它看起来是这样的:
<div class="row">
<div class="col-md-8"> <!-- 8 is the width of the left side -->
You content here
</div>
<div class="col-md-4"> <!-- 4 is the width of the right side -->
Your content here
</div>
</div>
你在这里满意吗
你的内容在这里
如果您需要使这些列中的内容也是网格,那么它将有点不同:
<div class="row">
<div class="col-md-8"> <!-- 8 is the width of the left side -->
<div class="row">
<div class="col-md-12"></div>
<!-- You just add your columns here -->
</div>
<div class="row">
<div class="col-md-12"></div>
<!-- You just add your columns here -->
</div>
</div>
<div class="col-md-4"> <!-- 4 is the width of the right side -->
<div class="row">
<div class="col-md-12"></div>
<!-- You just add your columns here -->
</div>
<div class="row">
<div class="col-md-12"></div>
<!-- You just add your columns here -->
</div>
</div>
</div>
使用以下代码:
<!DOCTYPE html>
<html>
<head>
<title>Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<style type="text/css">
.gray{border:5px solid gray;
height: 100px;
}
.green{border: 5px solid green;
height: 300px;
}
.orange{
border: 5px solid orange;
height: 350px;
}
.greenplus{border: 5px solid green;
height: 50px;
}
</style>
<body>
<div class="container" style="margin-top: 50px;">
<div class="row" >
<div class="col-lg-8 col-sm-8 col-md-8">
<div class="row" style="padding-left: 20px; padding-right: 20px;">
<div class="gray"></div>
<br>
<div class="green"></div>
</div>
</div>
<div class="col-lg-4 col-sm-4 col-md-4">
<div class="row" style="padding-left: 20px; padding-right: 20px;">
<div class="orange"></div>
<br>
<div class="greenplus"></div>
</div>
</div>
</div>
</div>
</body>
</html>
例子
.gray{边框:5px纯灰;
高度:100px;
}
.green{边框:5px纯绿色;
高度:300px;
}
.橙色{
边框:5px纯橙;
高度:350px;
}
.greenplus{边框:5px纯绿色;
高度:50px;
}
欢迎来到StackOverflow!请提供您的尝试的详细信息,例如,作为,以便我们能够尝试解决您的问题,并解释您自己的尝试失败的原因-这样您可以学到一些对您未来发展有用的东西,除了得到这个问题的答案外,我还附上了一张样本图片我想要这样排列的容器看看附件图片一旦你没有得到我想要的ask@RISHABHBANSAL你能再解释一下吗?先生,我已经在附图的帮助下解释过了。我想要这样的除法。这样我就可以用它们来写我的content@RISHABHBANSAL有没有这样的网站?我只是不明白你到底需要什么。这4个单独的容器是在两列中还是在两列中只有2个容器?