Bootstrap Cheat Sheet
by John Mason (masonjo) via cheatography.com/18871/cs/1992/
Rows - Grid System Typography Button Classes
Rows are in .container or .container-fluid .h1 .h2 .h3 .btn-default .btn-primary
.h4 .h5 .h6 .btn-success .btn-info
Columns
.small <small> .lead .btn-warning .btn-danger
.col-xs- Always Full
@font-size-base | @line-height-base .btn-link (to look like a link)
.col-sm- >768 750 wide
.btn-lg .btn-sm
.col-md- >992 970 wide Align
.btn-xs .btn-block
.col-lg- >1200 1170 wide .text-left .text-right .active (A tag) .disabled (A tag)
.text-center .text-justify disabled="disabled"
Resets, Offsets, Pushes, Pulls
.clearfix Text Helpers Labels
.col-xs-offset- ( sm, md, lg ) .text-muted .text-primary .label .label-default
Nest using a .row inside a col .text-success .text-info primary, success, info, warning, danger
.col-xs-push- ( sm, md, lg ) .text-warning .text-danger
<span class="label label-default">New</sp‐
.col-xs-pull- ( sm, md, lg ) .bg-primary .bg-success an>
.visible-xs ( sm, md, lg ) .bg-info .bg-warning
.hidden-xs ( sm, md, lg ) Badge
.bg-danger
.visible-print .text-hide .sr-only <span class="badge">42</span>
.hidden-print
Lists Alerts
Grid Variables .list-unstyled .list-inline .alert .alert-success
@grid-columns: 12 success, info, warning, or danger
Descriptions .alert-dismissable
@grid-gutter-width: 30px
@grid-float-breakpoint: 768px <dl> <dt>...</dt> <dd>...</dd> </dl> <button type="button" class="close" data-d‐
.dl-horizontal ismiss="alert" aria-hidden="true">×</‐
Using Grid Mixin CSS button>
Images <a href="#" class="alert-link">...</a>
.wrapper {.make-row();}
.content-main {.make-lg-column(8);} .img-responsive (max-width:100%,
.content-secondary { height:auto)
.make-lg-column(3); .img-rounded
.make-lg-column-offset(1);
.img-circle
}
.img-thumbnail (double border)
Using Grid Mixin HTML
Forms
<div class="wrapper">
NEED TO DO
<div class="content-main">...</div>
<div class="content-secondary">...</div>
Buttons
</div>
<button type="button" class="btn btn-defau‐
lt">Default</button>
<a href="#" class="btn btn-primary btn-lg
active" role="button">Primary link</a>
By John Mason (masonjo) Published 29th April, 2014. Sponsored by Readable.com
cheatography.com/masonjo/ Last updated 11th May, 2016. Measure your website readability!
www.e-rehab.com Page 1 of 3. https://readable.com
Bootstrap Cheat Sheet
by John Mason (masonjo) via cheatography.com/18871/cs/1992/
Tables Tags (cont)
.table .table-striped Clear Floats
.table-bordered .table-hover .clearfix
.table-condensed Center Block (mixin also)
.table-responsive .center-block (display:block, margin
Wrap .table in .table-responsive auto) | .center-block();
<div class='table-responsive'> Show (mixin also)
...table
.show | .show();
</div>
Hide (mixin also)
Rows or Cells .hide | .hide();
.active .success .info Glyphicons
.warning .danger <span class="glyphicon glyphicon-searc‐
h"></span>
Tags
abbr
<abbr title="attribute">attr</abbr>
address
<address> <strong>Twitter, Inc.</strong>
<br> 795 Folsom Ave, Suite 600<br>
San Francisco, CA 94107<br> <abbr
title="Phone">P:</abbr> (123) 456-7890
</address>
blockquote
<blockquote> <p>Lorem ipsum dolor sit
amet, consectetur adipiscing elit. Intege‐
r</p> </blockquote>
blockquote footer
<footer>Someone famous in <cite title="‐
Source Title">Source Title</cite></foot‐
er>
blockquote right justify
.blockquote-reverse
code
<code><section></code>
kbd Keyboard Entry
<kbd>cd</kbd>
.pre-scrollable
Max Height 350px box, with y-axis
scrollbar. Used with pre tag
close button
<button type="button" class="close" aria-
hidden="true">×</button>
Caret
<span class="caret"></span>
Floats
.pull-left .pull-right
Float Mixin
.element { .pull-left(); }
By John Mason (masonjo) Published 29th April, 2014. Sponsored by Readable.com
cheatography.com/masonjo/ Last updated 11th May, 2016. Measure your website readability!
www.e-rehab.com Page 2 of 3. https://readable.com