我需要使用bootstrap创建html页面,因为我无法创建此<div>
。这些<div>
也必须具有响应能力。
Image of div to be created
<div class="row">
<div class="bord2 col-md-4">
<h4 class="grey card-title">ABCD</h4>
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
</ul>
</div>
<div class="bord col-md-4">
<h4 class="grey card-title">ABCD</h4>
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
</ul>
</div>
<div class="bord col-md-4">
<h4 class="grey card-title">ABCD</h4>
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
</ul>
</div>
&#13;
答案 0 :(得分:0)
将您的代码放在容器中:
<div class="container">
...your code...
</div>
答案 1 :(得分:0)
为了使其响应,添加所有类引导程序,如col-lg-4 col-md-4 col-sm-4 col-xs-4
。这些是引导程序中用于响应的类。 LG
表示大型桌面md
表示平板电脑屏幕尺寸,xs和sm表示小型和xtra小型手机屏幕。
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<div class="container">
<div class="row">
<div class="bord2 col-lg-3 col-md-3 col-sm-4 col-xs-3" style="background-color:green">
<h4 class="grey card-title">ABCD</h4>
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
</ul>
</div>
<div class="bord col-lg-3 col-lg-offset-1 col-md-3 col-md-offset-1 col-sm-3 col-sm-offset-1 col-xs-3 col-xs-offset-1" style="background-color:blue">
<h4 class="grey card-title">ABCD</h4>
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
</ul>
</div>
<div class="bord col-lg-3 col-lg-offset-1 col-md-3 col-md-offset-1 col-sm-3 col-sm-offset-1 col-xs-3 col-xs-offset-1" style="background-color:grey">
<h4 class="grey card-title">ABCD</h4>
<ul>
<li>A</li>
<li>B</li>
<li>C</li>
</ul>
</div>
</div>
</body>
</html>
&#13;
当您开始使用bootstrap时,我建议您浏览this tutorial