Content (1): Reboot / Typography / Code
About Reboot (reset CSS introduced by Bootstrap 4). See the official document for detail.
Sample headings for h1 , h2 , h3 , h4 , h5 , and h6 .
Use .h(1|2|3|4|5|6) for elements other than heading. Below are examples used with span.
span.h(1|2|3|4|5|6)
Example using .text-muted for a secondary heading (see Text color)
Add .display-(1|2|3|4) to a heading to stand out (examples used in h1 below).
.display-(1|2|3|4) can be set arbitrary text elements (an example for span below).
span.display-4
Add .lead to stand out a paragraph.
(Without .lead) Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
(Using .lead) Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
mark example ⇒ You can use the mark tag to
highlight text.
del example ⇒
This line of text is meant to be treated as deleted text.
s example ⇒
This line of text is meant to be treated as no longer accurate.
ins example ⇒ This line of text is meant to be treated as an addition to the document.
u example ⇒
This line of text will render as underlined
small example ⇒ This line of text is meant to be treated as fine print.
strong example ⇒ This line rendered as bold text.
em example ⇒ This line rendered as italicized text.
abbr is used for abbreviations and acronyms. It shows text with a dotted underline and popups a tooltip on hover.
abbr
title="{full expression}" (popups a tooltip on hover).initialism displays slightly smaller (for acronyms)attr examples
attr
HTML
attr.initialism example (a bit smaller)
HTML
blockquote is used for quoting blocks of content from another source (an example below).
StructureLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
blockquote.blockquote
p.mb-1
Lorem ipsum ...footer.blockquote-footer
Someone famous in
cite Attribute
title="Source Title"Source TitleUse .text-(left|center|right) (see Text alignment )
Center/Right aligned variations of above example (Left aligned as default)
.text-center
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
.text-right
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
(ul|ol).list-unstyled removes default CSS list-style (displays the same as plain text). However, it does not apply to nested (descendant) list items. In the example below, fourth and fifth items are nested items.
Use (ul|ol).list-inline to arrange items inline (horizontally)
Elements for the description list (dl , dt , and dd) can be arranged responsively using grid. The following example show how to use grid for building a responsive description list (changed breakpoint from sm to md from the official example).
dl.row
dt.col-md-3 (placed on left 3/12 on ≥md)
.text-truncate to truncate textdd.col-md-9 (placed on right 9/12 on ≥md)
dl.row (inside is the same way as above)Vestibulum id ligula porta felis euismod semper eget lacinia odio sem nec elit.
Donec id elit non mi porta gravida at eget metus.
.text-truncate is applied hereUse code
Example ⇒ Math.sqrt(a*a + b*b)
Use code within pre
function determinant(a, b, c, d) {
return a*d - b*c;
}
pre.p-2.border.bg-light
code
function determinant(...< and > ) must be translated to character entity references (< , > , ...) respectively.Use var (displays italicized)
Example ⇒ D = b2 - 4 a c
Use kbd
Example ⇒ npm install --save-dev bootstrap
Use samp
Example ⇒ webpack: Compiled successfully.