Give your page an attention-grabbing header.
id="header"
).
class="jumbotron"
to it.
Make the jumbotron stretch the full width of the page (like it does on this page).
Give it a pretty background color.
<style type="text/css">...</style>
).
custom.css
, but this is
nice for just playing around.)
background
rule for
.jumbotron { ... }
. (#7d3c75 is a
nice color.)
color: white;
, say).
Or give it a fancy background image.
.jumbotron
like
background-image: url('http://www.zastavki.com/pictures/originals/2013/Animals___Cats_Maine_coon_cat_on_a_black_background_045533_.jpg');
.
(Substitute in your fave image as desired.)
color: white;
to keep your
header text readable.
background-size: 100%;
rule, or play around with the height
of your jumbotron.
Having trouble? Put a sticky note on your computer!
All done? Help people with sticky notes.
Because everyone needs navigation menus.
class="nav nav-tabs"
to your list..
<li>...</li>
item is actually a link (<a href="#">linktext</a>
).
The link doesn't have to go anywhere, but it needs
to be an <a>
element or the styles won't
apply.
class="active"
to the menu item
representing your current page.
Need some inspiration, or a reminder of the HTML syntax for lists? You can copy-paste this:
<ul class="nav nav-tabs">
<li>
<a href="#">
Shazam
</a>
</li>
<li class="active">
<a href="#">
Vesper
</a>
</li>
<li>
<a href="#">
All other cats on earth
</a>
</li>
</ul>
class="nav-pills"
instead of
class="nav-tabs"
.
class="nav-stacked"
to either
tabs or pills for a vertical menu.
class="nav-justified"
to make
your nav bar take the full width of the screen
at desktop sizes (will stack vertically on
smaller screens).
Having trouble? Put a sticky note on your computer!
All done? Help people with sticky notes.
Orderly yet customizable layout makes everything look professional.
Bootstrap is built on a twelve-column grid system. Its responsive magic takes care of how wide each column should be on each device, including padding. It also decides when sections should be stacked vertically vs. placed side-by-side. You just decide how many columns wide each of your sections should be.
If you can count to twelve, you can make good-looking layouts.
Post-it note exercise time!
FYI, these will only properly explain what I mean at desktop widths - the columns need to be able to stretch horizontally so you can see how the post-its align with the sections.
Half of 12 is 6, so each section is 6 columns across. 6 + 6 = 12.
col-md-6
)
col-md-6
)
1/4 of 12 is 3, so the sidebar is 3 columns wide. The other section is 9 columns wide. 3 + 9 = 12.
col-md-3
)
col-md-9
)
Your turn! You figure this one out. Compare notes with your neighbors and make sure you agree.
Your turn again! Let's do a three-section layout. Your left and right sidebars should each be 1/4 width; your main content area should be 1/2. Compare notes with your neighbors and make sure you agree.
You can also add offset classes, in case you'd like wide whitespace. Offsets will add X columns of white space to the left of their element.
This presentation has a 1-column offset, then a 10-column content area. 1 + 10 = 11; the 1 column we haven't accounted for yet is white space off to the right. It works out like this:
col-md-10 col-md-offset-1
)
The golden ratio has been celebrated since antiquity as a way to make things look harmonious. All you math nerds know that the Fibonacci sequence is intimately entwined with the golden ratio. That means you can make things look cool by using Fibonacci numbers for their width!
Try altering the base template so it has five sections, whose widths are (respectively) 1, 1, 2, 3, and 5 columns. (1 + 1 + 2 + 3 + 5 = 12. Hooray!) Make sure each section has some content so you can see how they relate to the whole.
Try it yourself:
id="text"
and
id="image"
.
class="col-md-6"
to each div.
Having trouble? Put a sticky note on your computer!
All done? Help people with sticky notes.
Now that you have a responsive layout, wouldn't it be sweet if your images scaled to fit, automatically?
class="img-responsive"
to the
image element.
class="img-thumbnail"
.
class="img-rounded"
(won't work on IE8).
class="img-circle"
(won't work on IE8).
Having trouble? Put a sticky note on your computer!
All done? Help people with sticky notes.