How to use Bootstrap to create three column layout
Three column layout
The following code uses three col-lg-4
, which
also adds to 12.
<!DOCTYPE HTML>
<html>
<head>
<link href="http://java2s.com/style/bootstrap.min.css" rel="stylesheet">
<style>div{background:#eee;border:1px solid #DDD;}</style>
</head><!-- w ww . j a va 2s .c om-->
<body style='margin:20px;'>
<div class="row">
<div class="col-lg-4">4</div>
<div class="col-lg-4">4</div>
<div class="col-lg-4">4</div>
</div>
</body>
</html>
From the code above we added margin to body to show the edge of the layout. And we also add border and background to the div element to show the border of the divs.