Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS Framework Basics Prototyping with Bootstrap Working with Nested Grids and Responsive Images

Making a Sidebar

Using the offset and grid columns, how would I make a setup with a main area that spans about 75% of the page and a right sidebar spanning the other 25%?

1 Answer

Hey Chase, Using the Bootstrap grid and predefined classes and you can do what you want using code like this.

<div class="row">
    <div class="col-sm-9">
    This is the the left part of your row spanning 75% of the page. With Bootstrap, there are a total of 12 columns, and 9 columns is equal to 75% of the total.
    <div class="col-sm-3">
    This will be the side bar, or the right side of your row, spanning 25% of the page, or three columns. These columns will stack on top of each other in small and extra small devices.  In devices bigger than "small" devices they will be together in the same row.