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

Developing webistes with CSS

HI,

So when i develop webistes with CSS, should i write the Mobile CSS first and then add media queries and work my way to to the desktop version?

2 Answers

Well first this is my first response to a forum questions because i'm new to this but this is what I learned from the current track i'm on, which is the front-end development track. We basically started doing our css from the mobile site first then started doing the desktop version along with it. YOu can do it either or but its best to start with the mobile site first then format desktop version.

If i'm wrong trust me others will tell you better than me but thats what I got from it unless i'm wrong.

  • Hope this helps

There isnt a wron ganswer you can start from that or that but i was just wondering and i know people and Nick Pettit , start from mobile. Since now more than 50% people goes on web from their mobiles, i think its better to do from mobile. Though, i think it will be easier to code it from mobile aswell since is easier to style things on desktop in my opinion.

I jsut coded a website from desktop but i think ill preffer from mobile first i guess.

Thank you for your answer ^^

Great question and good Answear cliffton belcher. To add on to it a little more.

The way css works is the code you put towards the bottom overrides any code you place on top which is why the mobile first approach works best. With that being said you should write the css you will be using across all platforms first then you can target different screen sizes with media queries. You should only be using media queries for when your layout breaks or does not look good on certain screen sizes. As you continue the track you will get to see the advantages of building mobile first as compared to building a desktop first approach. When I took the course they showed you both ways and told you by doing the mobile first was better. Not to sure if the videos have been updated since the . But regardless the above still holds true.

I have watched the new responsive CSS by Nick Pettit ( Advanced) and heres my question.

I have developed websites , portfolio more likely and i did actualy made some websites that works just fine , but i did code it from desktop and didnt find it cool.

I did once from mobile to desktop and i just saw that its a little different role . I cant write or say what i have to say . I didnt sleep for 20h or rather, its 05:30am now : p i should go sleep .