Section 2_Unit 1 Bootstrap
Section 2_Unit 1 Bootstrap
<!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. Mobile-first styles
are part of the core framework.
• To ensure proper rendering and touch zooming, add the following <meta> tag
inside the <head> element:
• 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
The .container-fluid class provides a full width container, spanning the entire
width of the viewport
<!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.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/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>
<!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.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h1>My First Bootstrap Page</h1>
<p>This part is inside a .container class.</p>
<p>The .container class provides a responsive fixed width container.</p>
</div>
</body>
</html>
Grid Classes
❑The Bootstrap grid system has four classes:
• With themes, we’ve made most, if not all, of the design decisions
upfront, so the product is ready to modify with your own content and
publish.
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Theme Made By www.w3schools.com - No Copyright -->
<title>Bootstrap Theme Simply Me</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.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
<style>
.bg-1 {
background-color: #1abc9c;
color: #ffffff;
}
</style>
</head>
<body>
<div class="bg-1">
<div class="container text-center">
<h3>Who Am I?</h3>
<img src="bird.jpg" class="img-circle" alt="Bird" width="350" height="350">
<h3>I'm an adventurer</h3>
</div>
</div>
</body>
</html>
Bootstrap CSS
• The most popular CSS framework for developing responsive and
mobile-first websites is Bootstrap.
• There are different types of CSS:
• Typography
• Button
• Form
• Images
• Tables
• Dropdown
• NAVs
Typography
• Bootstrap's global default font-size is 14px, with a line-height of 1.428.
• The classes below is used to style the elements further.
1) <h1> - <h6>: h1-h6 Heading
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<h1>h1 Bootstrap heading <small>(36px)</small></h1>
<h2>h2 Bootstrap heading <small>(30px)</small></h2>
<h3>h3 Bootstrap heading <small>(24px)</small></h3>
<h4>h4 Bootstrap heading <small>(18px)</small></h4>
<h5>h5 Bootstrap heading <small>(14px)</small></h5>
<h6>h6 Bootstrap heading <small>(12px)</small></h6>
</div>
</body>
</html>
2) .lead: Makes a text stand out: Stand out text
<body>
<div class="container">
<h2>Typography</h2>
<p>Use the .lead class to make a paragraph "stand out":</p>
<p class="lead">This paragraph stands out.</p>
<p>This is a regular paragraph.</p>
</div>
</body>
2) <mark> or .mark : Highlights text: Highlighted text
• Form:
• Individual form controls automatically receive some global styling with
Bootstrap.
• All textual <input>, <textarea>, and <select> elements with class="form-
control" are set to width: 100%; by default. (Make responsive)
• Standard rules for all three form layouts:
• Wrap labels and form controls in <div class="form-group"> (needed for
optimum spacing)
• Add class .form-control to all textual <input>, <textarea>, <select> elements.