Badges

New badges are available on mobile and desktop. Click on badges to view code. Here is the library of SVG icons.

Gold
VIP
VIP
Verified
Confirmed
Online
On IMC
Broadcasting
#1 Fan
#[2-99] Fan
Friends
Broadcasting with Sound

Color Classes

.sprite-dislike .dislike
.sprite-like .green
.sprite-friends .blue
.sprite-points .gold
.sprite-new-matches .yellow
.sprite-check .green
.sprite-x .grey
.sprite-close .white
.sprite-activity-feed
.sprite-add
.sprite-album-add
.sprite-album
.sprite-ambassador
.sprite-apps
.sprite-back-arrow
.sprite-back
.sprite-badge-broadcasting
.sprite-badge-broadcasting-sound
.sprite-badge-confirmed
.sprite-badge-crown
.sprite-badge-friends
.sprite-badge-imc
.sprite-badge-mobileim
.sprite-badge-more-h
.sprite-badge-more-v
.sprite-badge-online
.sprite-badge-verified
.sprite-bling
.sprite-block
.sprite-broadcast
.sprite-cart
.sprite-chat
.sprite-check
.sprite-circle-block
.sprite-circle-empty
.sprite-circle-half
.sprite-clock
.sprite-close
.sprite-comment
.sprite-contests
.sprite-credit
.sprite-crop
.sprite-crown
.sprite-dislike
.sprite-down-arrow
.sprite-download
.sprite-edit
.sprite-envelope
.sprite-envelope2
.sprite-exclamation
.sprite-exclamation2
.sprite-expand
.sprite-external
.sprite-eye
.sprite-fav-photos
.sprite-fav-videos
.sprite-flag
.sprite-flirt-face
.sprite-flower
.sprite-folder
.sprite-forward-arrow
.sprite-forward
.sprite-friend-seal
.sprite-friends
.sprite-gift
.sprite-globe
.sprite-grid
.sprite-heart
.sprite-home
.sprite-hotlist
.sprite-hotornot
.sprite-ignore
.sprite-imc
.sprite-kick-user
.sprite-layers
.sprite-leaderboard
.sprite-like
.sprite-link
.sprite-lips
.sprite-lists
.sprite-local-search
.sprite-lock
.sprite-menu
.sprite-mic-mute
.sprite-mic
.sprite-mobile
.sprite-money
.sprite-more-h
.sprite-more-v
.sprite-mute
.sprite-new-matches
.sprite-notification
.sprite-paperclip
.sprite-pause
.sprite-pen
.sprite-person
.sprite-phone
.sprite-photo-add
.sprite-photo-verified
.sprite-photos
.sprite-place-1
.sprite-place-2
.sprite-place-3
.sprite-play
.sprite-play2
.sprite-points
.sprite-profile-views
.sprite-question
.sprite-question2
.sprite-refresh
.sprite-reload
.sprite-row
.sprite-sad
.sprite-save
.sprite-search
.sprite-settings
.sprite-side-smile
.sprite-smiley
.sprite-sound
.sprite-speaker
.sprite-star
.sprite-straight-face
.sprite-tag
.sprite-tap
.sprite-testimonials
.sprite-topfan
.sprite-trash
.sprite-unlock
.sprite-upload
.sprite-videos-add
.sprite-videos
.sprite-x

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

Example body text

This is the example body text, with an example like in 14px size with a normal font-weight of 400 to increase readability. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nullam id dolor id nibh ultricies vehicula.

This line of text is meant to be treated as fine print.

This snippet of text is rendered as light with a weight of 300.

This snippet of text is rendered as bold with a weight of 600.

The following snippet of text is rendered as italicized text.

An abbreviation of the word attribute is attr.

Emphasis classes

Fusce dapibus, tellus ac cursus commodo, tortor mauris nibh.

Nullam id dolor id nibh ultricies vehicula ut id elit.

Etiam porta sem malesuada magna mollis euismod.

Donec ullamcorper nulla non metus auctor fringilla.

Duis mollis, est non commodo luctus, nisi erat porttitor ligula.

Maecenas sed diam eget risus varius blandit sit amet non magna.

Lists

  • Lorem ipsum dolor sit amet
  • consectetur adipiscing elit
  • Integer posuere erat a ante.
  1. Lorem ipsum dolor sit amet
  2. consectetur adipiscing elit
  3. Integer posuere erat a ante.

Blockquotes

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

Someone famous in Source Title

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.

Someone famous in Source Title
# Column heading Column heading Column heading
1 Column content Column content Column content
2 Column content Column content Column content
3 Column content Column content Column content
4 Column content Column content Column content
5 Column content Column content Column content
6 Column content Column content Column content
7 Column content Column content Column content
Legend
A longer block of help text that breaks onto a new line and may extend beyond one line.

Check out Bootstrap Select for other dropdown menu options

 

Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.

Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit.

Pagination

Notifications

Notifications only appear on a new page that is navigated to. They do not appear as AJAX notifications.

This is for non-vital announcements or non-vital actions we'd like users to make vel scelerisque nisl consectetur et.

This is for informing users something they did was a success.

This is for informing users they need to do something now. (ex. "Your membership is about to expire! Renew membership.")

Alerts

Alerts appear as AJAX notifications near the action that fired the call or above all the main content of the page, but not attached to the navbar, like notifications.

Warning - Needs attention, but not important

Warning!

Best check yo self, you're not looking too good. Nulla vitae elit libero, a pharetra augue. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

Failure - Something went wrong

Oh snap! Change a few things up and try submitting again.

Success - Something went correctly

Well done! You successfully read this important alert message.

Announcement - New feature or message

Heads up! This alert needs your attention, but it's not super important.

Labels

Default Primary Success Warning Danger Info

Basic

Small

Jumbotron

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

Learn more

List groups

Panels

Basic panel
Panel heading
Panel content
Panel content

Panel primary

Panel content

Panel success

Panel content

Panel warning

Panel content

Panel danger

Panel content

Panel info

Panel content

Wells

Look, I'm in a well!
Look, I'm in a small well!
Look, I'm in a large well!

Collapsible Panels

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

Modals

Popovers

Tooltips

Likebox & Activity Feed

Likebox and Activity Feed should have the same function and design. Right and left arrows on hover in the photo frame should scroll through the current album the featured photo belongs to. Comments will change accordingly. Number next to Album title in the overlay should calculate the number of photos in the album being displayed.

Member Info Container

IM Cells

Profile Top (In Hotlist & Friends List)

  • LeiaOrgana
  • Confirmed VIP
  • 30F • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977

Profile Top with Status (Online)

  • LeiaOrgana
  • Confirmed VIP
  • 30F • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977
Governor Tarkin, I should have expected to find you holding Vader's leash! I recognized your foul stench when I was brought on board. I'm surprised that you had the courage to take the responsibility yourself.

Personal Profile Top

  • HanSolo
  • Verified Gold
  • 42M • Corillia, CA (0 miles away)
  • I Know.
  • Looking for Man, Woman
  • Joined: 5/25/1977

Grid

col-lg-9      col-md-12
col-lg-3
col-md-3
col-md-9
col-xs-6
img: 96x96
  • col-xs-6
col-xs-12
col-xs-3
img: 120 in row
img: 163 in grid
row1
row2
col-xs-3
float:right in row
float:left in grid
col-xs-3
img: 120 in row
img: 163 in grid
row1
row2
col-xs-3
float:right in row
float:left in grid
col-xs-3
img: 120 in row
img: 163 in grid
row1
row2
col-xs-3
float:right in row
float:left in grid
col-xs-3
img: 120 in row
img: 163 in grid
row1
row2
col-xs-3
float:right in row
float:left in grid

col-xs-12

col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
Profile Photos (30) Untitled 9/14/2015 Like
  • LeiaOrgana
  • 30F
  • Confirmed VIP
  • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977
  • Received a comment on this photo
HanSolo 38M
6 hours ago
Corillia, Ca
Uh, we had a slight weapons malfunction, but uh... everything's perfectly all right now. We're fine. We're all fine here now, thank you. How are you?
× Delete
HanSolo 38M
6 hours ago
Corillia, Ca
Uh, uh... negative, negative. We had a reactor leak here now. Give us a few minutes to lock it down. Large leak, very dangerous.
× Delete
HanSolo 38M
6 hours ago
Corillia, Ca
Boring conversation anyway.
× Delete
HanSolo 38M
6 hours ago
Corillia, Ca
LUKE, WE'RE GONNA HAVE COMPANY!
× Delete

Governor Tarkin, I should have expected to find you holding Vader's leash! I recognized your foul stench when I was brought on board.

05/03/2008
  • LeiaOrgana
  • 30F
  • Confirmed VIP
  • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977
  • Received a comment on this status
HanSolo 38M
6 hours ago
Corillia, Ca
Uh, we had a slight weapons malfunction, but uh... everything's perfectly all right now. We're fine. We're all fine here now, thank you. How are you?
× Delete
HanSolo 38M
6 hours ago
Corillia, Ca
Uh, uh... negative, negative. We had a reactor leak here now. Give us a few minutes to lock it down. Large leak, very dangerous.
× Delete
HanSolo 38M
6 hours ago
Corillia, Ca
Boring conversation anyway.
× Delete
HanSolo 38M
6 hours ago
Corillia, Ca
LUKE, WE'RE GONNA HAVE COMPANY!
× Delete
  • LeiaOrgana
  • 30F
  • Confirmed VIP
  • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977
  • Became friends with HanSolo

Advertising Column

Grid

col-lg-9      col-md-12
col-lg-3
col-md-3
col-md-9
col-xs-6
img: 96x96
  • col-xs-6
col-xs-12
col-xs-3
img: 120 in row
img: 163 in grid
row1
row2
col-xs-3
float:right in row
float:left in grid
col-xs-3
img: 120 in row
img: 163 in grid
row1
row2
col-xs-3
float:right in row
float:left in grid
col-xs-3
img: 120 in row
img: 163 in grid
row1
row2
col-xs-3
float:right in row
float:left in grid
col-xs-3
img: 120 in row
img: 163 in grid
row1
row2
col-xs-3
float:right in row
float:left in grid

col-xs-12

col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
col-xs-2
My Saved Searches

Create a new saved search to find matches with one click!

Find a...

Looking for a...

Between...

and

Within...
Join Date
Last Login
Show...

View as:
  • LeiaOrgana
  • 30F
  • Confirmed VIP
  • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977
  • LeiaOrgana
  • 30F
  • Confirmed VIP
  • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977
  • LeiaOrgana
  • 30F
  • Confirmed VIP
  • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977
  • LeiaOrgana
  • 30F
  • Confirmed VIP
  • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977

Advertising Column

  • LeiaOrgana
  • 30F
  • Confirmed VIP
  • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977
  • LeiaOrgana
  • 30F
  • Confirmed VIP
  • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977
  • LeiaOrgana
  • 30F
  • Confirmed VIP
  • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977
  • LeiaOrgana
  • 30F
  • Confirmed VIP
  • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977
  • LeiaOrgana
  • 30F
  • Confirmed VIP
  • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977
  • LeiaOrgana
  • 30F
  • Confirmed VIP
  • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977
  • LeiaOrgana
  • 30F
  • Confirmed VIP
  • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977
  • LeiaOrgana
  • 30F
  • Confirmed VIP
  • Alderaan, CA 5 miles away
  • I Love You
  • Looking for Man, Woman
  • Joined: 5/25/1977
Men
Women
Couples/Groups
TS/TV/TG

Bootstrap includes a responsive, mobile first fluid grid system that appropriately scales up to 12 columns as the device or viewport size increases. It includes predefined classes for easy layout options, as well as powerful mixins for generating more semantic layouts.

Introduction

Grid systems are used for creating page layouts through a series of rows and columns that house your content. Here's how the Bootstrap grid system works:

Look to the examples for applying these principles to your code.

Media queries

We use the following media queries in our Less files to create the key breakpoints in our grid system.

Copy
/* Extra small devices (phones, less than 768px) */
/* No media query since this is the default in Bootstrap */

/* Small devices (tablets, 768px and up) */
@media (min-width: @screen-sm-min) { ... }

/* Medium devices (desktops, 992px and up) */
@media (min-width: @screen-md-min) { ... }

/* Large devices (large desktops, 1200px and up) */
@media (min-width: @screen-lg-min) { ... }

We occasionally expand on these media queries to include a max-width to limit CSS to a narrower set of devices.

Copy
@media (max-width: @screen-xs-max) { ... }
@media (min-width: @screen-sm-min) and (max-width: @screen-sm-max) { ... }
@media (min-width: @screen-md-min) and (max-width: @screen-md-max) { ... }
@media (min-width: @screen-lg-min) { ... }

Grid options

See how aspects of the Bootstrap grid system work across multiple devices with a handy table.

Extra small devices Phones (<768px) Small devices Tablets (≥768px) Medium devices Desktops (≥992px) Large devices Desktops (≥1200px)
Grid behavior Horizontal at all times Collapsed to start, horizontal above breakpoints
Container width None (auto) 750px 970px 1170px
Class prefix .col-xs- .col-sm- .col-md- .col-lg-
# of columns 12
Column width Auto ~62px ~81px ~97px
Gutter width 30px (15px on each side of a column)
Nestable Yes
Offsets Yes
Column ordering Yes

Example: Stacked-to-horizontal

Using a single set of .col-md-* grid classes, you can create a basic grid system that starts out stacked on mobile devices and tablet devices (the extra small to small range) before becoming horizontal on desktop (medium) devices. Place grid columns in any .row.

.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-1
.col-md-4
.col-md-8
.col-md-4
.col-md-4
.col-md-4
.col-md-6
.col-md-6
Copy
<div class="row">
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
  <div class="col-md-1">.col-md-1</div>
</div>
<div class="row">
  <div class="col-md-4">.col-md-8</div>
  <div class="col-md-8">.col-md-4</div>
</div>
<div class="row">
  <div class="col-md-4">.col-md-4</div>
  <div class="col-md-4">.col-md-4</div>
  <div class="col-md-4">.col-md-4</div>
</div>
<div class="row">
  <div class="col-md-6">.col-md-6</div>
  <div class="col-md-6">.col-md-6</div>
</div>

Example: Fluid container

Turn any fixed-width grid layout into a full-width layout by changing your outermost .container to .container-fluid.

Copy
<div class="container-fluid">
  <div class="row">
    ...
  </div>
</div>

Example: Mobile and desktop

Don't want your columns to simply stack in smaller devices? Use the extra small and medium device grid classes by adding .col-xs-* .col-md-* to your columns. See the example below for a better idea of how it all works.

.col-xs-12 .col-md-8
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6 .col-md-4
.col-xs-6
.col-xs-6
Copy
<!-- Stack the columns on mobile by making one full-width and the other half-width -->
<div class="row">
  <div class="col-xs-12 col-md-8">.col-xs-12 .col-md-8</div>
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>

<!-- Columns start at 50% wide on mobile and bump up to 33.3% wide on desktop -->
<div class="row">
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>

<!-- Columns are always 50% wide, on mobile and desktop -->
<div class="row">
  <div class="col-xs-6">.col-xs-6</div>
  <div class="col-xs-6">.col-xs-6</div>
</div>

Example: Mobile, tablet, desktop

Build on the previous example by creating even more dynamic and powerful layouts with tablet .col-sm-* classes.

.col-xs-12 .col-sm-6 .col-md-8
.col-xs-6 .col-md-4
.col-xs-6 .col-sm-4
.col-xs-6 .col-sm-4
.col-xs-6 .col-sm-4
Copy
<div class="row">
  <div class="col-xs-12 col-sm-6 col-md-8">.col-xs-12 .col-sm-6 .col-md-8</div>
  <div class="col-xs-6 col-md-4">.col-xs-6 .col-md-4</div>
</div>
<div class="row">
  <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
  <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
  <!-- Optional: clear the XS cols if their content doesn't match in height -->
  <div class="clearfix visible-xs-block"></div>
  <div class="col-xs-6 col-sm-4">.col-xs-6 .col-sm-4</div>
</div>

Example: Column wrapping

If more than 12 columns are placed within a single row, each group of extra columns will, as one unit, wrap onto a new line.

.col-xs-9
.col-xs-4
Since 9 + 4 = 13 > 12, this 4-column-wide div gets wrapped onto a new line as one contiguous unit.
.col-xs-6
Subsequent columns continue along the new line.
Copy
<div class="row">
  <div class="col-xs-9">.col-xs-9</div>
  <div class="col-xs-4">.col-xs-4<br>Since 9 + 4 = 13 &gt; 12, this 4-column-wide div gets wrapped onto a new line as one contiguous unit.</div>
  <div class="col-xs-6">.col-xs-6<br>Subsequent columns continue along the new line.</div>
</div>

Responsive column resets

With the four tiers of grids available you're bound to run into issues where, at certain breakpoints, your columns don't clear quite right as one is taller than the other. To fix that, use a combination of a .clearfix and our responsive utility classes.

.col-xs-6 .col-sm-3
Resize your viewport or check it out on your phone for an example.
.col-xs-6 .col-sm-3
.col-xs-6 .col-sm-3
.col-xs-6 .col-sm-3
Copy
<div class="row">
  <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
  <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>

  <!-- Add the extra clearfix for only the required viewport -->
  <div class="clearfix visible-xs-block"></div>

  <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
  <div class="col-xs-6 col-sm-3">.col-xs-6 .col-sm-3</div>
</div>

In addition to column clearing at responsive breakpoints, you may need to reset offsets, pushes, or pulls. See this in action in the grid example.

Copy
<div class="row">
  <div class="col-sm-5 col-md-6">.col-sm-5 .col-md-6</div>
  <div class="col-sm-5 col-sm-offset-2 col-md-6 col-md-offset-0">.col-sm-5 .col-sm-offset-2 .col-md-6 .col-md-offset-0</div>
</div>

<div class="row">
  <div class="col-sm-6 col-md-5 col-lg-6">.col-sm-6 .col-md-5 .col-lg-6</div>
  <div class="col-sm-6 col-md-5 col-md-offset-2 col-lg-6 col-lg-offset-0">.col-sm-6 .col-md-5 .col-md-offset-2 .col-lg-6 .col-lg-offset-0</div>
</div>

Offsetting columns

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.

.col-md-4
.col-md-4 .col-md-offset-4
.col-md-3 .col-md-offset-3
.col-md-3 .col-md-offset-3
.col-md-6 .col-md-offset-3
Copy
<div class="row">
  <div class="col-md-4">.col-md-4</div>
  <div class="col-md-4 col-md-offset-4">.col-md-4 .col-md-offset-4</div>
</div>
<div class="row">
  <div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
  <div class="col-md-3 col-md-offset-3">.col-md-3 .col-md-offset-3</div>
</div>
<div class="row">
  <div class="col-md-6 col-md-offset-3">.col-md-6 .col-md-offset-3</div>
</div>

Nesting columns

To nest your content with the default grid, add a new .row and set of .col-sm-* columns within an existing .col-sm-* column. Nested rows should include a set of columns that add up to 12 or fewer (it is not required that you use all 12 available columns).

Level 1: .col-sm-9
Level 2: .col-xs-8 .col-sm-6
Level 2: .col-xs-4 .col-sm-6
Copy
<div class="row">
  <div class="col-sm-9">
    Level 1: .col-sm-9
    <div class="row">
      <div class="col-xs-8 col-sm-6">
        Level 2: .col-xs-8 .col-sm-6
      </div>
      <div class="col-xs-4 col-sm-6">
        Level 2: .col-xs-4 .col-sm-6
      </div>
    </div>
  </div>
</div>

Column ordering

Easily change the order of our built-in grid columns with .col-md-push-* and .col-md-pull-* modifier classes.

.col-md-9 .col-md-push-3
.col-md-3 .col-md-pull-9
Copy
<div class="row">
  <div class="col-md-9 col-md-push-3">.col-md-9 .col-md-push-3</div>
  <div class="col-md-3 col-md-pull-9">.col-md-3 .col-md-pull-9</div>
</div>

Less mixins and variables

In addition to prebuilt grid classes for fast layouts, Bootstrap includes Less variables and mixins for quickly generating your own simple, semantic layouts.

Variables

Variables determine the number of columns, the gutter width, and the media query point at which to begin floating columns. We use these to generate the predefined grid classes documented above, as well as for the custom mixins listed below.

Copy
@grid-columns:              12;
@grid-gutter-width:         30px;
@grid-float-breakpoint:     768px;

Mixins

Mixins are used in conjunction with the grid variables to generate semantic CSS for individual grid columns.

Copy
// Creates a wrapper for a series of columns
.make-row(@gutter: @grid-gutter-width) {
  // Then clear the floated columns
  .clearfix();

  @media (min-width: @screen-sm-min) {
    margin-left:  (@gutter / -2);
    margin-right: (@gutter / -2);
  }

  // Negative margin nested rows out to align the content of columns
  .row {
    margin-left:  (@gutter / -2);
    margin-right: (@gutter / -2);
  }
}

// Generate the extra small columns
.make-xs-column(@columns; @gutter: @grid-gutter-width) {
  position: relative;
  // Prevent columns from collapsing when empty
  min-height: 1px;
  // Inner gutter via padding
  padding-left:  (@gutter / 2);
  padding-right: (@gutter / 2);

  // Calculate width based on number of columns available
  @media (min-width: @grid-float-breakpoint) {
    float: left;
    width: percentage((@columns / @grid-columns));
  }
}

// Generate the small columns
.make-sm-column(@columns; @gutter: @grid-gutter-width) {
  position: relative;
  // Prevent columns from collapsing when empty
  min-height: 1px;
  // Inner gutter via padding
  padding-left:  (@gutter / 2);
  padding-right: (@gutter / 2);

  // Calculate width based on number of columns available
  @media (min-width: @screen-sm-min) {
    float: left;
    width: percentage((@columns / @grid-columns));
  }
}

// Generate the small column offsets
.make-sm-column-offset(@columns) {
  @media (min-width: @screen-sm-min) {
    margin-left: percentage((@columns / @grid-columns));
  }
}
.make-sm-column-push(@columns) {
  @media (min-width: @screen-sm-min) {
    left: percentage((@columns / @grid-columns));
  }
}
.make-sm-column-pull(@columns) {
  @media (min-width: @screen-sm-min) {
    right: percentage((@columns / @grid-columns));
  }
}

// Generate the medium columns
.make-md-column(@columns; @gutter: @grid-gutter-width) {
  position: relative;
  // Prevent columns from collapsing when empty
  min-height: 1px;
  // Inner gutter via padding
  padding-left:  (@gutter / 2);
  padding-right: (@gutter / 2);

  // Calculate width based on number of columns available
  @media (min-width: @screen-md-min) {
    float: left;
    width: percentage((@columns / @grid-columns));
  }
}

// Generate the medium column offsets
.make-md-column-offset(@columns) {
  @media (min-width: @screen-md-min) {
    margin-left: percentage((@columns / @grid-columns));
  }
}
.make-md-column-push(@columns) {
  @media (min-width: @screen-md-min) {
    left: percentage((@columns / @grid-columns));
  }
}
.make-md-column-pull(@columns) {
  @media (min-width: @screen-md-min) {
    right: percentage((@columns / @grid-columns));
  }
}

// Generate the large columns
.make-lg-column(@columns; @gutter: @grid-gutter-width) {
  position: relative;
  // Prevent columns from collapsing when empty
  min-height: 1px;
  // Inner gutter via padding
  padding-left:  (@gutter / 2);
  padding-right: (@gutter / 2);

  // Calculate width based on number of columns available
  @media (min-width: @screen-lg-min) {
    float: left;
    width: percentage((@columns / @grid-columns));
  }
}

// Generate the large column offsets
.make-lg-column-offset(@columns) {
  @media (min-width: @screen-lg-min) {
    margin-left: percentage((@columns / @grid-columns));
  }
}
.make-lg-column-push(@columns) {
  @media (min-width: @screen-lg-min) {
    left: percentage((@columns / @grid-columns));
  }
}
.make-lg-column-pull(@columns) {
  @media (min-width: @screen-lg-min) {
    right: percentage((@columns / @grid-columns));
  }
}

Example usage

You can modify the variables to your own custom values, or just use the mixins with their default values. Here's an example of using the default settings to create a two-column layout with a gap between.

Copy
.wrapper {
  .make-row();
}
.content-main {
  .make-lg-column(8);
}
.content-secondary {
  .make-lg-column(3);
  .make-lg-column-offset(1);
}
Copy
<div class="wrapper">
  <div class="content-main">...</div>
  <div class="content-secondary">...</div>
</div>