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

Bootstrap 3 and Responsive Design - px, em, or %?

Hey all,

I am currently working on a project and noticed it is almost fully responsive (with media queries) by default thanks to Twitter Bootstrap 3.

I added a few JS plugins to adjust my navbar. I am having a few issues though. I have a few pictures and set widths on divs that aren't adjusting in size. I am unclear on how this process actually works (with media queries). Furthermore, when I set the width and picture dimensions with percentages, it does adjust but I am not getting my desired size and proportions.

I don't understand how 90% of my site adjusts to proper dimensions but about 10% of it is way off.

I tried watching the media queries video but I didn't unfortunately I didn't get what I was looking for.

Does anyone have any advice or know of any good tutorials on Bootstrap 3's responsive/media query features?

Thanks!

2 Answers

Scooter,

This is a site i refer to a lot, I've linked to the responsive page here but the rest of the site makes for some good reading too.

Hope it helps.

also you may want to take a look at this responsive grid system, its pretty cool.

Scooter:

It's impossible to know what areas of your site are not working the way you envisioned they would without being able to see it in my own browser. Anecdotally, most of the time something does not override correctly, it is because there is a more specific CSS rule in place somewhere in Bootstrap. I usually use Chrome Web Dev Tools (or Firebug) to figure out where a specific rule is coming from, and then write one more specific.

My own preference is to use ems and percentages rather than pixels, whenever possible.