CSS CSS Layout Basics Getting Started with CSS Layout Using a Mobile First Approach

sunmin yun
sunmin yun
2,880 Points

Media query - Approaching Mobile Websites first ?

Hello my friends, So I was told in this lecture video and few other videos regarding media queries. It makes sense to create mobile size websites first and making your way up. So when ever I work on new projects creating a website, should i need to create a media query first before anything else?

Enea Jorgji
Enea Jorgji
6,038 Points

Mobile first approach - it is about coding with special classes, taking in consideration that the website will look good in different size of screens.

2 Answers

Ryan McFarlane
Ryan McFarlane
11,368 Points

No. The mobile first approach is simply that all of the styles outside of media queries apply to everything (including mobile) and then min-width media queries are used to add complexity and/or overwrite styles for larger viewport sizes.

This means that mobiles won't even need to load the styles that aren't required for mobile and therefore reduces load time and improves the mobile experience.

Hope this helps :)

sunmin yun
sunmin yun
2,880 Points

Ryan McFarlane Thank you :D Will keep that in mind ! Again, Thanks so much for the reply!!