Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

CSS CSS Layout Techniques Grid Layout Testing our Grid

VISHAL DEEPAK
VISHAL DEEPAK
3,272 Points

What is the purpose of specifing "@media (min-width: 1px) and (max-width: 767px) " In a mobile first approach?

Cant seem to understand the above statements

@media (min-width: 1px) and (max-width: 767px){
 //Code hidden for brevity 
}

In a mobile first approach? We need to give this? We could have directly written this without any media query

2 Answers

Jaime Rios
PLUS
Jaime Rios
Courses Plus Student 21,100 Points

I think you can omit that but it is better to add that piece of code as a fallback.

VISHAL DEEPAK
VISHAL DEEPAK
3,272 Points

Thankx for your reply, but i still dont get it

I think it is to prevent the container from collapsing