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

Media queries next to fix my responsiveness?

Hey guys, I've built my first portfolio page, yes I know it needs work....I've just finished the media queries section will that fix my responsiveness issues? or do i need a complete CSS overhaul?

walrusdev.com

thanks Justin

Jamie Carter
seal-mask
.a{fill-rule:evenodd;}techdegree
Jamie Carter
Front End Web Development Techdegree Student 12,096 Points

You can add media queries to your current CSS flow.

Of course some parts may need refactoring but usually if you are methodical enough you can just add them to your existing template.

I usually nest my mediaqueries inside my classses

section {
  text-align: center;
  line-height: 2em;
  width: 100%;
  mediaquery (small){
    styling
  }
}

Note I use SASS to do this

2 Answers

Mark Wilkowske
PLUS
Mark Wilkowske
Courses Plus Student 18,131 Points

My approach would be to fix two issues before looking at media queries. Typo in doctype declaration and missing semicolon in .navbar selector, then develop for the x-small browser first. You have a nice layout going so far.

Fixed! thanks for catching it and the info. Is there a best practice for placement? or is it preference?

I hope there is more practice further along as its just trial and error at this point while looking things up.

Thanks Justin

Mark Wilkowske
Mark Wilkowske
Courses Plus Student 18,131 Points

Starting out I put media queries at the end of the style sheet which is recommended here in the coursework. This helped me better understand responsive design and the cascade in CSS. Another technique is to put the query directly below the targeted selector. either way for your workflow.

https://css-tricks.com/forums/topic/where-to-put-css3-media-queries/