<! DOCTYPE html> <html lang="en">
<head>
<meta charset="UTF-8"> <title>Title</title> <! -- Mobile device preferred --> <meta name="viewport" content="width=device-width, initial-scale=1"> <! --> <link rel="stylesheet" href="bootstrap/css/bootstrap.css"> <! -- Bootstrap. js must be imported in jquery. js before importing bootstrap.js --> <script type="text/javascript" src="bootstrap/js/jquery.min.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>
<style>
div[class^="col-md"]{
border: solid 1px red;
}
.row{
margin-bottom: 20px;
}
</style>
</head>
<body>
<div class="container"> <! This is made up of rows and columns --> <divclass="row">
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div> </div> <! -- column offset --> <divclass="row">
<div class="col-md-2 col-md-offset-2">col-md-2</div>
<div class="col-md-3">col-md-3</div>
<div class="col-md-4">col-md-4</div>
</div>
</div>
</body>
</html>
Copy the code
Nested columns
To nest content again using the built-in raster system, you can add a new.row element and a series of.col-sm-* elements to existing.col-sm-* elements. A nested row can contain no more than 12 columns (there is no requirement that you fill all 12 columns).
<! DOCTYPE html> <html lang="en">
<head>
<meta charset="UTF-8"> <title>Title</title> <! -- Mobile device preferred --> <meta name="viewport" content="width=device-width, initial-scale=1"> <! --> <link rel="stylesheet" href="bootstrap/css/bootstrap.css"> <! -- Bootstrap. js must be imported in jquery. js before importing bootstrap.js --> <script type="text/javascript" src="bootstrap/js/jquery.min.js"></script>
<script type="text/javascript" src="bootstrap/js/bootstrap.js"></script>
<style>
div[class^="col-md"]{
border: solid 1px red;
}
div[class^="col-sm"]{
border: solid 1px red;
}
.row{
margin-bottom: 20px;
}
</style>
</head>
<body>
<div class="container"> <! This is made up of rows and columns --> <divclass="row">
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div>
<div class="col-md-1">col-md-1</div> </div> <! -- column offset --> <divclass="row">
<div class="col-md-2 col-md-offset-2">col-md-2</div>
<div class="col-md-3">col-md-3</div>
<div class="col-md-4">col-md-4</div> </div> <! Nested columns --> <divclass="row"> <! --div.col-md-2.col-md-offset-2-->
<div class="col-md-2 col-md-offset-2">col-md-2</div>
<div class="col-md-3">col-md-3</div>
<div class="col-md-4">col-md-4
<div class="row">
<div class="col-sm-4"> column nested </div> <divclass="col-sm-4"> column nested </div> <divclass="col-sm-4"> column nested </div> <divclass="col-sm-4"> column nested < / div > < / div > < / div > < / div > < / div > < / body > < / HTML >Copy the code