ELF Tudy Ootstrap
ELF Tudy Ootstrap
ELF Tudy Ootstrap
SELF-STUDY 2 BOOTSTRAP
The learning activities in this self-study (a.k.a PRIOR to Tutorial) are designed to consolidate and extend your
understanding of the topics covered in lectures in week 2.
You should complete all activities and questions until the tutorial in week 3.
BOOTSTRAP
One of the problems with basic HTML design is that the webpage may look different in different browser or
device (such as mobile, laptop or tablet). Therefore, it was required to modify some code according to browser
or device. Bootstrap can resolve this problem easily.
WHAT IS BOOTSTRAP
Bootstrap is a framework which uses HTML, CSS and JavaScript for the web design. All the major browsers e.g.,
FireFox, Chrome, Safari, etc can support Bootstrap. Bootstrap also has several predefined classes for easy layouts
including dropdown button, navigation bar and alerts etc. Using Bootstrap, you can easily build responsive
designs (Responsive web design: creating web sites which automatically adjust and change their layout to look
good on all devices from small phone to large desktops).
DOWNLOAD BOOTSTRAP
You can download Bootstrap from getbootstrap.com to get the compiled CSS and JavaScript, source code. If you
want to download and host Bootstrap 4, please go to https://getbootstrap.com/docs/4.4/getting-
started/download/ and follow the instructions.
BOOTSTRAP 4 CDN
You can include the CDN file to use Bootstrap 4. In this method, we do not need to download the files, but
provide the links to these files(https://getbootstrap.com/docs/4.4/getting-started/introduction/)
1) Copy-paste the stylesheet <link> into your <head> before all other stylesheets to load our CSS.
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"
integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh"
crossorigin="anonymous">
1
Semester 1, 2020
2) Place following <script>s near the end of your pages, right before the closing </body> tags, to enable
them.
CONTAINERS
Containers are the basic layout element in Bootstrap and are required when using the default grid system.
Container classes are used to wrap the page’s contents.
2
Semester 1, 2020
.container .container-fluid
3
Semester 1, 2020
The table below illustrates how each container’s max-width compares to the original.
GRID SYSTEM
Bootstrap 4 divides each row up to 12 columns across the page. The grid system is responsive, and the
columns will re-arrange automatically depending on the screen size.
4
Semester 1, 2020
5
Semester 1, 2020
6
Semester 1, 2020
TYPOGRAPHY
It creates headings, paragraphs, lists and other inline elements. It specifies how text elements should be
rendered on the web page.
HEADINGS
Bootstrap 4 provides HTML headings from h1 to h6 as below
7
Semester 1, 2020
FIGURE 6. HEADINGS.HTML
DISPLAY HEADINGS
The display headings are used to display the text with large front size and font weight than the normal headings
by using classes of display heading: .display -1, .display -2, .display-3 and .display-4.
8
Semester 1, 2020
FIGURE 8. DISPLAYHEADINGS.HTML
TABLE
Bootstrap 4 has a basic table style with some light padding and horizontal dividers. If you want to use the basic
table style, add the .table class to the <table> element.
9
Semester 1, 2020
BUTTON
Bootstrap 4 provides clickable button to put content such as text and images. You can create button by using
the .btn class flowed by desired style (e.g. btn-success).
10
Semester 1, 2020
The size of the button also can be set using ‘lg’, ‘md’ and ‘xs’.
NAVIGATION BARS
Navbar provides navigation headers for your application or sites. It can collapse or extend depending on your
screen size.
To create a basic nav bar, add the .navbar class with responsive collapsing class .navbar-expand-xl|lg|md|sm
(provides navbar on extra larg, large, medium or small screen). You also can add links to the navbar by adding
an unordered list with .navbar-nav class.
11
Semester 1, 2020
12
Semester 1, 2020
FORM
The form element is used to collect input from users by using field such as text field, checkboxes, or buttons etc.
You can wrap labels and controls in a <div> element with the class .form-group and add another class of .form-
control to all textual <input>, <textarea>, and <select> elements.
13
Semester 1, 2020
MODAL FORM
Modal from appears in the pop-up window as below.
When you click the button “click me” on the web page, the model-form appears in the pop-up window. The code
of above output is as below.
https://getbootstrap.com/docs/4.3/getting-started/introduction/
14
Semester 1, 2020
15