HTML & CSS #10 : Bootstrap
- 3. What ?
« Bootstrap is the most popular
HTML, CSS, and JS framework
for developing responsive, mobile
first projects on the web. »
http://getbootstrap.com
- 4. Framework ?
A software framework is an abstraction in which
software providing generic functionality can be
selectively changed by additional user-written code,
thus providing application-specific software.
http://en.wikipedia.org
- 5. Mobile first ?
« Adapting the design process to
start by designing the mobile
version of an application first and
then going upwards. »
- 9. Save time“All we have to decide is what to do with the time that is given us.” - Gandalf
- 15. Basic template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<h1>Hello, world!</h1>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
</body>
</html>
- 20. Rows (1)
« Use rows to create horizontal
groups of columns. »
http://getbootstrap.com/css/#grid-intro
- 21. Rows (2)
Rows must be placed within a .container
or .container-fluid for proper alignment and padding.
Only columns may be immediate children of rows
- 23. Columns (1)
« Bootstrap includes a responsive,
mobile first fluid grid system that
appropriately scales up to 12
columns as the device or
viewport size increases »
http://getbootstrap.com/css/#grid-intro
- 24. Columns (2)
Content should be placed within columns
Grid columns are created by specifying the number
of twelve available columns you wish to span.
Grid classes apply to devices with screen widths
greater than or equal to the breakpoint sizes
- 26. Columns (4)
<div class="container">
<div class="row">
<div class="col-md-8">.col-md-8</div>
<div class="col-md-4">.col-md-4</div>
</div>
<div class="row">
<div class="col-md-4">.col-md-4</div>
<div class="col-md-4">.col-.md-4</div>
<div class="col-md-4">.col-md-4</div>
</div>
<div class="row">
<div class="col-md-6">.col-md-6</div>
<div class="col-md-6">.col-md-6</div>
</div>
</div>
- 27. Columns (5)
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div>
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>
<div class="row">
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
<div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>
<div class="row">
<div class="col-xs-6">.col-xs-6</div>
<div class="col-xs-6">.col-xs-6</div>
</div>
</div>
- 30. Add a Custom Stylesheet
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap 101 Template</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="css/custom.css">
</head>