What is Bootstrap?
- Bootstrap is a free front-end framework for faster and easier web development
- Bootstrap also gives you the ability to easily create responsive designs
1. Add the HTML
Bootstrap require the HTML5 doctype.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
</html>
2. Bootstrap 3 is mobile-first
Bootstrap 3 is designed to be responsive to mobile devices.
To ensure proper rendering and touch zooming, add the following
<meta>
tag inside the <head>
element:
<meta name="viewport" content="width=device-width, initial-scale=1">
The
width=device-width
part sets the width of the page to follow the screen-width of the device (which will vary depending on the device).
The
initial-scale=1
part sets the initial zoom level when the page is first loaded by the browser.
3. Containers
Bootstrap also requires a containing element to wrap site contents.
There are two container classes to choose from:
- The
.container
class provides a responsive fixed width container - The
.container-fluid
class provides a full width container, spanning the entire width of the viewport
below is a simple bootstrap responsive page code
<!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="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h1>My First Bootstrap Page</h1>
<p>we welcome you</p>
<p>we are glad you join us</p>
</div>
</body>
</html>
shrink the image to see how responsive your page can be
0 comments:
Post a Comment