bootstrap4_tutorial.pdf

(3956 KB) Pobierz
i
About the Tutorial
Twitter Bootstrap is the most popular front end framework in the recent time. It
is sleek, intuitive, and powerful mobile first front-end framework for faster and
easier web development. It uses HTML, CSS and Javascript.
This tutorial will teach you the basics of Bootstrap Framework using which you
can create web projects with ease. The tutorial is divided into sections such as
Bootstrap Basic Structure, Bootstrap CSS, Bootstrap Layout Components and
Bootstrap Plugins. Each of these sections contain related topics with simple and
useful examples.
Audience
This tutorial has been prepared for anyone who has a basic knowledge of HTML
and CSS and has an urge to develop websites. After completing this tutorial you
will find yourself at a moderate level of expertise in developing web projects
using Twitter Bootstrap.
Prerequisites
Before you start proceeding with this tutorial, we are assuming that you are
already aware about the basics of HTML and CSS. If you are not well aware of
these concepts then we will suggest you to go through our short tutorial on
HTML Tutorial and CSS Tutorial.
Copyright & Disclaimer
Copyright 2014 by Tutorials Point (I) Pvt. Ltd.
All the content and graphics published in this e-book are the property of
Tutorials Point (I) Pvt. Ltd. The user of this e-book is prohibited to reuse, retain,
copy, distribute or republish any contents or a part of contents of this e-book in
any manner without written consent of the publisher.
We strive to update the contents of our website and tutorials as timely and as
precisely as possible, however, the contents may contain inaccuracies or errors.
Tutorials Point (I) Pvt. Ltd. provides no guarantee regarding the accuracy,
timeliness or completeness of our website or its contents including this tutorial.
If you discover any errors on our website or in this tutorial, please notify us at
contact@tutorialspoint.com
i
Table of Contents
About the Tutorial ····································································································································· i
Audience ···················································································································································· i
Prerequisites ·············································································································································· i
Copyright & Disclaimer ······························································································································ i
Table of Contents ······································································································································ ii
1. OVERVIEW····························································································································· 1
What is Twitter Bootstrap? ······················································································································· 1
History ······················································································································································ 1
Why Use Bootstrap? ································································································································· 1
What Bootstrap Package Includes? ··········································································································· 2
2. ENVIRONMENT SETUP··········································································································· 3
Download Bootstrap ································································································································· 3
File structure ············································································································································· 4
HTML Template ········································································································································ 4
3. GRID SYSTEM························································································································· 7
What is a Grid? ········································································································································· 7
What is Bootstrap Grid System? ··············································································································· 7
Working of Bootstrap Grid System ············································································································ 8
Media Queries ·········································································································································· 8
Grid Options ············································································································································· 9
Responsive Column Resets······················································································································ 15
Offset Columns ······································································································································· 17
Nesting Columns ····································································································································· 18
Column Ordering····································································································································· 19
ii
4. CSS OVERVIEW ···················································································································· 22
HTML5 doctype ······································································································································· 22
Mobile First············································································································································· 22
Responsive Images ·································································································································· 23
Typography and Links ····························································································································· 23
Normalize ··············································································································································· 23
Containers ·············································································································································· 23
5. TYPOGRAPHY······················································································································· 25
Headings ················································································································································· 25
Lead Body Copy ······································································································································ 26
Emphasis ················································································································································· 27
Abbreviations ········································································································································· 27
Addresses ··············································································································································· 28
Blockquotes ············································································································································ 28
Lists························································································································································· 30
6. CODE ··································································································································· 33
7. TABLES ································································································································ 34
Basic Table ·············································································································································· 34
Optional Table Classes ···························································································································· 35
Contextual classes··································································································································· 40
Responsive tables ··································································································································· 41
8. FORMS ································································································································ 44
Form Layout ············································································································································ 44
Supported Form Controls ························································································································ 47
Static Control ·········································································································································· 51
iii
Form Control States ································································································································ 52
Form Control Sizing ································································································································· 54
Help Text ················································································································································ 56
9. BUTTONS····························································································································· 57
Button Size·············································································································································· 58
Button State············································································································································ 60
Button Tags ············································································································································· 63
10. IMAGES ······························································································································· 64
11. HELPER CLASSES·················································································································· 65
Close icon················································································································································ 65
Carets ····················································································································································· 65
Quick Floats ············································································································································ 65
Center Content Blocks····························································································································· 66
Clearfix···················································································································································· 66
Showing and Hiding Content ··················································································································· 67
Screen Reader Content ··························································································································· 67
12. RESPONSIVE UTILITIES········································································································· 69
Print Classes ············································································································································ 69
13. GLYPHICONS ······················································································································· 71
What are Glyphicons? ····························································································································· 71
Where to find Glyphicons? ······················································································································ 71
Usage ······················································································································································ 71
14. DROPDOWNS ······················································································································ 73
Options ··················································································································································· 74
iv
Zgłoś jeśli naruszono regulamin