Get Started with bootstrap
Install
-
Can use CDN or download the JS and CSS to use Bootstrap without network connection.
-
Need jQuery and popper to support it if running bootstrap locally without network. html setup example:
<!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, shrink-to-fit=no"> <meta http-equiv="x-ua-compatible" content="ie=edge"> <link rel="stylesheet" href="css/bootstrap.min.css"> <title>Bootstrap</title> </head> <body> <div class="container"> </div><!-- content container --> <script src="js/jquery.slim.min.js"></script> <!-- The sequence of rendering these files really matters --> <script src="js/popper.min.js"></script> <script src="js/bootstrap.min.js"></script> </body> </html>
basic layout
-
The
<link rel="stylesheet" href="css/bootstrap.min.css">
applies basic style to the web page and make it looks great, adaptive to different screen sizes. -
can use
class = display-(1-4)
to make the title larger than regular<h>
tags.
Topographic utilities
-
Horizontal alignment
-
text-justify
-
text-(XX)-POS
.- XX: sm, md, lg, xl
- POS: lfet, center, right
-
-
Line height alignment
align-SID
- SID: baseline, top, middle, bottom, text-bottom, text-top, right
-
Text-captialization
text-TYP
- TYP: lowercase, uppercase, captialize, nomospace
- Text-styles
font-STYL
- STYL: italic, weight-normal,
weight-light(r)
,weight-bold(r)
- STYL: italic, weight-normal,
- Text-modifier
text-decoration-none
text-reset
this one removes everything of that link text, leave it matching the parent settings.
- Flow
test-FLOW
FLOW: wrap, nowarp, break, turncate
lists and blockquote
- lists
list-unstyled
removes the dots infornt of<li>
- inline lists
list-inline
on ULlist-inline-item
on each LI
- blockquotes
blockquote
makes the text biggerblockquote-footer
makes the footer gray and looks good
Using colors
- text color
text-COLOR
here this COLOR is color group- COLOR: primary, secondary, danger, etc.
- background color
bg-COLOR
same deal- COLOR: primary,, secondary, danger, etc.
work with img
- basic responsive images
img-fluid
- responsive images
img-thumbnail
- rounded 1px border
- Rounded
- rounded(-SID)(-SHA)(-SIZ)
- SID: top, right, bottom, left
- SHA: circle, pill
- SIZ: 0, sm, lg
- they meant to be individual. do NOT use them all together.
- rounded(-SID)(-SHA)(-SIZ)
- Aligning img
float-left
orfloat-right
text-center
: center inlinemx-auto
: center block
- Figures
figure
on the<figure>
tagfigure-img
on the images
CSS variables
-
use –(var) to call it and
:root
to defign it.<style> :root { --pink: #c4226f } </style> <h1 style="color: var(--pink);">