Thursday, January 26, 2017

Bootstrap Example- Two (container-fluid)

Bootstrap Example- Two (container-fluid)

 What is Containers?

Bootstrap also requires a containing element to wrap site contents.

There are two container classes to choose from:

  1. The "container" class provides a responsive fixed width container
  2. The "container-fluid" class provides a full width container, spanning the entire width of the viewport

Note: Containers are not nestable (you cannot put a container inside another container).

Write the code below:

<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
  <div class="container-fluid">
  <h1>My First Bootstrap Page</h1>     
  <p>This part is inside a .container-fluid class.</p>
  <p>The .container-fluid class provides a full width container, spanning the entire width of the viewport.</p>          
</div>
</body>
</html>

You will get the Result:

My First Bootstrap Page

This part is inside a .container-fluid class.
The .container-fluid class provides a full width container, spanning the entire width of the viewport.

No comments:

Post a Comment