Bootstrap Grid

Bootstrap Grid : The Bootstrap grid system has four break point class:- xs (for phones), sm (for tablets), md (for desktops), lg (for larger desktops).

Grid layout
———————————–

<!DOCTYPE html>
<html>
<head>
<meta charset=“utf-8”>
<title> Bootstrap </title>
<meta name=“viewport” content=“width=device-width, initial-scale=1”>

<!– Bootstrap css file –>
<link rel=“stylesheet” href=“https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css”>
<link rel=“stylesheet” href=“https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css”>

</head>
<body>

<div class=“container”>
<div class=“row”>
<h1> Four equal-width columns for large desktops </h1>
<div class=“col-lg-3 bg-success”>
Grid column col-lg-3
</div>
<div class=“col-lg-3 bg-success”>
Grid column col-lg-3
</div>
<div class=“col-lg-3 bg-success”>
Grid column col-lg-3
</div>
<div class=“col-lg-3 bg-success”>
Grid column col-lg-3
</div>
</div>
<br>
<div class=“row”>
<h1> Four equal-width columns for desktops </h1>
<div class=“col-md-3 bg-primary”>
Grid column col-md-3
</div>
<div class=“col-md-3 bg-primary”>
Grid column col-md-3
</div>
<div class=“col-md-3 bg-primary”>
Grid column col-md-3
</div>
<div class=“col-md-3 bg-primary”>
Grid column col-md-3
</div>
</div>
<br>
<div class=“row”>
<h1> Four equal-width columns for Small devices Tablets </h1>
<div class=“col-sm-3 bg-info”>
Grid column col-sm-3
</div>
<div class=“col-sm-3 bg-info”>
Grid column col-sm-3
</div>
<div class=“col-sm-3 bg-info”>
Grid column col-sm-3
</div>
<div class=“col-sm-3 bg-info”>
Grid column col-sm-3
</div>
</div>
<br>
<div class=“row”>
<h1> Four equal-width columns for Extra small devices Phones </h1>
<div class=”col-xs-3 bg-danger”>
Grid column col-xs-3
</div>
<div class=“col-xs-3 bg-danger”>
Grid column col-xs-3
</div>
<div class=“col-xs-3 bg-danger”>
Grid column col-xs-3
</div>
<div class=”col-xs-3 bg-danger”>
Grid column col-xs-3
</div>
</div>
</div>

</div>

<!– Bootstrap css file –>

<script src=“https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js”></script>
<script src=“https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js”></script>

</body>

</html>

RESULT:

bootstrap-grid




Leave a Reply

avatar
  Subscribe  
Notify of