T7 Bootstrap
T7 Bootstrap
n Advantages of Bootstrap:
n Easy to use: Anybody with just basic knowledge of HTML and CSS can start
using Bootstrap
n Responsive features: Bootstrap's responsive CSS adjusts to phones, tablets,
and desktops
n Mobile-first approach: In Bootstrap 3, mobile-first styles are part of the
core framework
n Browser compatibility: Bootstrap is compatible with all modern browsers
(Chrome, Firefox, Internet Explorer, Safari, and Opera)
Where to Get Bootstrap?
n There are two ways to start using Bootstrap on your own web site.
n Download Bootstrap from getbootstrap.com
n If you want to download and host Bootstrap yourself, go
to getbootstrap.com, and follow the instructions there.
n Include Bootstrap from a CDN
n If you don't want to download and host Bootstrap yourself, you can
include it from a CDN (Content Delivery Network).
n MaxCDN provides CDN support for Bootstrap's CSS and JavaScript.
You must also include jQuery.
Bootstrap CDN
n You must include the following Bootstrap’s CSS, JavaScript, and jQuery from MaxCDN into your web page.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
</head>
</html>
Create Web Page with Bootstrap (2)
n Bootstrap is mobile-first
n Bootstrap 3 is designed to be responsive to mobile devices. Mobile-first
styles are part of the core framework.
n To ensure proper rendering and touch zooming, add the
following <meta> tag inside the <head> element:
n 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).
n The initial-scale=1 part sets the initial zoom level when the page is first
loaded by the browser.
Create Web Page with Bootstrap (3)
n Containers
n Bootstrap also requires a containing element to wrap site contents.
n There are two container classes to choose from:
n The .container class provides a responsive fixed width container.
n The .container-fluid class provides a full width container, spanning
the entire width of the viewport.
n If you do not want to use all 12 columns individually, you can group
the columns together to create wider columns:
<div class="col-md-12">Span 12 columns</div>
<div class="row">
<div class="col-*-*"></div>
</div>
<div class="row">
<div class="col-*-*"></div>
<div class="col-*-*"></div>
<div class="col-*-*"></div>
</div>
<div class="row">
...
</div>
n A basic Bootstrap table has a light padding and only horizontal dividers.
n The .table class adds basic styling to a table:
n Striped Rows
n The .table-striped class adds zebra-stripes to a table:
n Bordered Table
n The .table-bordered class adds borders on all sides of the table and cells:
n Hover Rows
n The .table-hover class enables a hover state on table rows:
n Responsive Tables
n The .table-responsive class creates a responsive table. The table will then scroll
horizontally on small devices (under 768px). When viewing on anything larger than
768px wide, there is no difference:
Bootstrap Images
n Rounded Corners
n The .img-rounded class adds rounded corners to an image (IE8 does not support rounded
corners):
n Circle
n The .img-circle class shapes the image to a circle (IE8 does not support rounded corners):
n Thumbnail
n The .img-thumbnail class shapes the image to a thumbnail:
n Responsive Images
n Images comes in all sizes. So do screens. Responsive images automatically adjust to fit the
size of the screen.
n Create responsive images by adding an .img-responsive class to the <img> tag. The image
will then scale nicely to the parent element.
n The .img-responsive class applies display: block; and max-width: 100%; and height: auto; to
the image:
Bootstrap Buttons
n Button Styles
n Bootstrap provides seven styles of buttons with the following classes:
.btn-default
.btn-primary
.btn-success
.btn-info
.btn-warning
.btn-danger
.btn-link
Bootstrap Button Elements
.btn-lg
.btn-md
.btn-sm
.btn-xs
Block Level Buttons
n A block level button spans the entire width of the parent element.
n Add class .btn-block to create a block level button:
Active/Disabled Buttons