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>

Click to view the demo

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.





















Home »
  Bootstrap »
    Example »




Accordion
Alert
Auto Complete
Badge
Breadcrum
Button
Carousel
Collapse
Dialog
Dropdown
Form
Icon
Jumbotron
Label
Layout
List
List Group
Media
Navigation Bar
Pager
Page Header
Panel
Paragraph
Pills
Popover
ProgressBar
ScrollSpy
Switch
Tab
Table
Thumnail
Tooltip
Tree
Well