UW Credit Union uses a mobile-first, fluid grid system that scales up to 12 columns as the device or viewport size increases. Our grid system is based on the Bootstrap grid system, but uses our breakpoints (defined above) and is always fluid, which means the .container
is always full-width.
.container
for proper alignment and padding..row
s to create horizontal groups of columns..col-xs-4
, and only columns may be immediate children of rows.padding
. That padding is offset in rows for the first and last column via negative margin on .row
s..col-xs-4
..col-md-*
class to an element will not only affect its styling on medium devices but also on large devices if a .col-lg-*
class is not present.Using a single set of .col-md-*
grid classes, you can create a basic grid system that starts out stacked on mobile devices before becoming horizontal on larger devices and desktop.
Using more than one col-*
class will allow you to change a column's width based on device/viewport size.
Move columns to the right using .col-md-offset-*
classes. These classes increase the left margin of a column by *
columns. For example, .col-md-offset-4
moves .col-md-4
over four columns.
Change the order of grid columns with .col-md-push-*
and .col-md-pull-*
modifier classes.
For more grid system examples, view the Bootstrap documentation.
Flexbox allows you to do a lot more to layout content or data. Centering vertically and horizontally becomes easier as well as other things.
.row
or .flex-column
to the parent container of the items you would like to flex.
.row
or .flex-column
(see classes tagged with "default").
Use .row
or .row-reverse
on the parent <div>
to make the children flex horizontally.
.align-items-*
classes on the parent <div>
to align the children vertically.
.align-items-stretch
so you get this automatically with adding class .row
or .row-reverse
. This makes the children all of equal height and is unique to flexbox.
.justify-content-*
classes on the parent <div>
to align the children horizontally.
.justify-content-flex-start
so you get this automatically with adding class .row
or .row-reverse
.flex-*
classes on the parent <div>
to wrap or not wrap the children.
.flex-nowrap
and you get this automatically with adding class .row
or .row-reverse
.
.align-content-*
classes on the parent <div>
to align the content vertically.
.align-items-start
so you get this automatically with adding class .row
or .row-reverse
.
Use .flex-column
or .flex-column-reverse
on the parent <div>
to make the children flex vertically.
.align-items-*
classes on the parent <div>
to align the children horizontally.
.align-items-stretch
so you get this automatically with adding class .flex-column
or .flex-column-reverse
.
.justify-content-*
classes on the parent <div>
to align the children vertically.
.justify-content-flex-start
so you get this automatically with adding class .flex-column
or .flex-column-reverse
.
.flex-*
classes on the parent <div>
to wrap or not wrap the children.
.flex-nowrap
and you get this automatically with adding class .flex-column
or .flex-column-reverse
.
.align-content-*
classes on the parent <div>
to align the content horizontally.
.align-content-flex-start
so you get this automatically with adding class.flex-column
or .flex-column-reverse
.
.align-self-*
classes on the children to align the children vertically in a .row
or horizontally in a .flex-column
..row
will need to have a height larger than the content for this to be noticible..flex-column
will need to have a width larger than the content for this to be noticible..flex-grow-*
classes on the children. flex-grow:0
and you get this automatically with .row
or .flex-column
classes on the parent. .flex-shrink-*
classes on the children.flex-shrink:1
and you get this automatically with .row
or .flex-column
classes on the parent. .flex-grow-1 .flex-shrink-1
Minions ipsum tank yuuu! Ti aamoo! Hana dul sae butt ti aamoo! Underweaaar jiji tank yuuu!
Tatata bala tu ti aamoo! Belloo! Tulaliloo para tú chasy bappleees tank yuuu! Chasy jeje. Tatata bala tu gelatooo bappleees jiji underweaaar belloo! Poulet tikka masala bappleees. Gelatooo poopayee bananaaaa hahaha uuuhhh butt bappleees aaaaaah ti aamoo! Tulaliloo baboiii po kass bappleees bee do bee do bee do bee do bee do bee do daa hana dul sae bappleees bappleees hahaha. Hahaha baboiii poulet tikka masala me want bananaaa! Bee do bee do bee do tulaliloo potatoooo tank yuuu! Underweaaar jiji tank yuuu! Wiiiii tank yuuu! Tatata bala tu po kass daa me want bananaaa! Gelatooo potatoooo wiiiii jiji uuuhhh baboiii bee do bee do bee do. Pepete uuuhhh jeje belloo! Daa bananaaaa me want bananaaa!
.flex-grow-1 .flex-shrink-1
Minions ipsum tank yuuu! Ti aamoo! Hana dul sae butt ti aamoo! Underweaaar jiji tank yuuu!
Tatata bala tu ti aamoo! Belloo! Tulaliloo para tú chasy bappleees tank yuuu! Chasy jeje. Tatata bala tu gelatooo bappleees jiji underweaaar belloo! Poulet tikka masala bappleees. Gelatooo poopayee bananaaaa hahaha uuuhhh butt bappleees aaaaaah ti aamoo! Tulaliloo baboiii po kass bappleees bee do bee do bee do bee do bee do bee do daa hana dul sae bappleees bappleees hahaha. Hahaha baboiii poulet tikka masala me want bananaaa! Bee do bee do bee do tulaliloo potatoooo tank yuuu! Underweaaar jiji tank yuuu! Wiiiii tank yuuu! Tatata bala tu po kass daa me want bananaaa! Gelatooo potatoooo wiiiii jiji uuuhhh baboiii bee do bee do bee do. Pepete uuuhhh jeje belloo! Daa bananaaaa me want bananaaa!
Using .col-*
classes will allow you to change a column's width base on device/viewport size. All columns once side by side will be of equal height. This is unique to flexbox.
.col-xs-12 .col-md-4
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
.col-xs-12 .col-md-4
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus in maximus diam. Nulla fermentum convallis quam a tempus. Nulla dolor ex, ornare non ipsum vitae, sodales faucibus ex.
.col-xs-12 .col-md-4
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus in maximus diam. Nulla fermentum convallis quam a tempus. Nulla dolor ex, ornare non ipsum vitae, sodales faucibus ex. Proin metus enim, mattis vitae felis quis, tristique hendrerit sapien. In blandit turpis turpis. Aenean felis metus, maximus vitae pulvinar sit amet, iaculis ac nisl. Ut congue commodo enim et euismod. Mauris posuere felis auctor ante egestas sagittis ac id enim.
.col-xs-6 .col-md-4
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
.col-xs-6 .col-md-8
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus in maximus diam. Nulla fermentum convallis quam a tempus. Nulla dolor ex, ornare non ipsum vitae, sodales faucibus ex. Proin metus enim, mattis vitae felis quis, tristique hendrerit sapien. In blandit turpis turpis. Aenean felis metus, maximus vitae pulvinar sit amet, iaculis ac nisl. Ut congue commodo enim et euismod. Mauris posuere felis auctor ante egestas sagittis ac id enim.
.col-xs-12 .col-md-2
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
.col-xs-12 .col-md
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus in maximus diam. Nulla fermentum convallis quam a tempus. Nulla dolor ex, ornare non ipsum vitae, sodales faucibus ex. Proin metus enim, mattis vitae felis quis, tristique hendrerit sapien. In blandit turpis turpis. Aenean felis metus, maximus vitae pulvinar sit amet, iaculis ac nisl. Ut congue commodo enim et euismod. Mauris posuere felis auctor ante egestas sagittis ac id enim.
.col-xs-12 .col-md-2
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus in maximus diam. Nulla fermentum convallis quam a tempus. Nulla dolor ex, ornare non ipsum vitae, sodales faucibus ex.
.col-xs-12 .col-md-2
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus in maximus diam. Nulla fermentum convallis quam a tempus. Nulla dolor ex, ornare non ipsum vitae, sodales faucibus ex.
.col-xs-6 .col-md-3
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
.col-xs
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus in maximus diam. Nulla fermentum convallis quam a tempus. Nulla dolor ex, ornare non ipsum vitae, sodales faucibus ex. Proin metus enim, mattis vitae felis quis, tristique hendrerit sapien. In blandit turpis turpis. Aenean felis metus, maximus vitae pulvinar sit amet, iaculis ac nisl. Ut congue commodo enim et euismod. Mauris posuere felis auctor ante egestas sagittis ac id enim.
Use the responsive .table-*
classes to display tabular data as a table on larger devices/viewports and stacked at smaller sizes.
Responsive CSS tables use the display:table
property to turn a div into a table at the specified (*) breakpoint .table-*
.
Apply any of the .bg-*
classes to add a background color to an entire row, or an individual cell.
Use the responsive .flex-table-*
classes to display information as a table on larger devices/viewports and stacked by column or row at smaller sizes.
Use .flex-order-*
to display in columns at MD+. Use .deco-cols
to apply a border around each column.
Use .column-directional
as a child of .flex-table-md
to position it between two columns.
Use .column-directional
as a child of a .flex-table-cell
to position it between two cells on MD+.
Omit .flex-order-*
to display in rows at MD+. Use .deco-rows
to apply a border around each row.
CSS Grid has less mark up and allows items to take up columns AND rows. Children can be postioned pretty much anywhere without changing the markup order. Centering vertically and horizontally becomes easier as well as other things.
.grid-*
and declare the number of columns .cols-*
and/or rows .rows-*
on the parent container. The children will automatically be grid items.
.grid
(see classes tagged with "default").
.colspan-*
and .rowspan-*
and/or their position in the grid (.postion-col-*
or .position-row-*
) at different breakpoints.
.grid
, .grid-sm
, .grid-md
, .grid-lg
or .grid-xl
.class="cols-1 cols-sm-2 cols-md-3 cols-lg-6 cols-xl-12"
.class="rows-1 rows-sm-2 rows-md-3 rows-lg-6 rows-xl-12"
..auto-flow-*
(See Auto Flow below).cols-md-6
will be 6 columns for md, lg and xl, unless you declare the other breakpoints.
.cols-*
or .rows-*
and then declare the larger screens sizes sm-*,-md-*, lg-* & xl-*. Examples: class="cols-1 cols-md-6 cols-lg-12"
.grid_item
- *Required .colspan-*
and/or .rowspan-*
Examples: class="colspan-4 colspan-lg-2 rowspan-4 rowspan-lg-2"
..position-col-*
and/or .position-row*
Examples: class="postion-row-4 postion-row-lg-2 position-col-4 postion-col-lg-2"
..colspan-md-6
will span 6 columns for md, lg and xl, unless you declare the other breakpoints.
.colspan-*
, .rowspan-*
, .position-row-*
, .positon-col-*
and then declare the larger screens sizes sm-*, md-*, lg-* & xl-*. Examples: class="colspan-1 colspan-sm-6 colspan-md-8"
.postion-col-1 .position-row-1 .colspan-2 .rowspan-6
.position-col-3 .rowspan-3
.position-col-4 .position-row-1 .rowspan-3
.position-col-5 .postion-row-1 .rowspan-6
.position-row-4 .position-col-3.rowspan-3
.position-row-4 .position-col-4.rowspan-3
.colspan-2 .rowspan-1
.colspan-2 .rowspan-3 .position-row-2
.rowspan-4
.colspan-2 .rowspan-1
.colspan-2 .rowspan-3
.colspan-2 .rowspan-1
.colspan-2 .rowspan-3 .position-col-4 .position-row-2
.rowspan-4
.colspan-2 .rowspan-1
.colspan-2 .rowspan-3
.grid-auto-flow-*
classes on the parent <div>
to automatically add columns or rows as needed..grid-auto-flow-column
, declare the number of rows and then the content will flow down the column and create additonal columns as needed. .grid-auto-flow-row
, declare the number of columns (or max the children a set width) and then the content will flow accross the column and create additonal rows as needed. .grid-auto-flow-row
Optional use of .grid-column-gap
, .grid-row-gap
, or .grid-gap
, classes on the parent <div>
to give a gap between columns, rows or both.
.justify-content-*
classes on the parent <div>
to align the content horizontally (row axis) .
Align Content is not supported by IE11 - we can begin using this when we stop supporting IE11
.align-content-*
classes on the parent <div>
to align the content horizontally (row axis) .
Justify Items is not supported by IE11 - we can begin using this when we stop supporting IE11
.justify-items-*
classes on the parent <div>
to align the children horizontally..justify-items-stretch
so you get this automatically with adding class .grid
Align Items is not supported by IE11 - we can begin using this when we stop supporting IE11
.align-items-*
classes on the parent <div>
to align the ALL children vertically..align-items-stretch
so you get this automatically with adding class .grid
. This makes the children all of equal height.Justify Self is not supported by IE11 - we can begin using this when we stop supporting IE11
.justify-self-*
classes on the child <div>
to align a single child horizontally.
.justify-self-stretch
so you get this automatically with adding class .grid
.
.align-self-*
classes on the child <div>
to align a single child vertically.
.align-self-stretch
so you get this automatically with adding class .grid
.