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

HTML

Media Queries Vs Mobile sites

Hello all,

I have a question to discuss and to know the best practice answer, When is the best time to use media queries to make my website responsive using the same markup, and when to use another version of the website (markup) like (m.mywebsite) ? I hope my question is clear enough :)

Thank you.

1 Answer

In the short answer for the first part it is when you resize you site and it starts to break that's when you should use media queries. and keep using them till the site is responsive.

secondly the whole (m.mywebsite) is not actually a responsive thing, its called a native site. so they are fully made sites separately to the desktop site mark up. then using JavaScript you can do screen tracking where you can determine the users screen size and if they are using a mobile device you can do a url redirect.

in my opinion, I would stick with making a responsive site, it may seem like more work but in the long run it is really worth it. there are plenty of tools to help do it on firefox alone there are multiple plugins that help with screen resolutions and breakpoints.

Hope this helps

Thank you Toby Bowley for your answer, Yes you are right, but what is your message for those people (developers) who say that (I have a huge website, with many pages inside, and it will cost me a longer markup if I want to meet the responsive idea in it, so why I don`t just create a new view ?)

I am with you, and I believe that using media queries will make it such easier and much better, but what is your message for such people and idea I mentioned up ?

Thank you Toby Bowley for your answer, Yes you are right, but what is your message for those people (developers) who say that (I have a huge website, with many pages inside, and it will cost me a longer markup if I want to meet the responsive idea in it, so why I don`t just create a new view ?)

I am with you, and I believe that using media queries will make it such easier and much better, but what is your message for such people and idea I mentioned up ?

Ok, I think I understand, my opinion is that if it is a smaller company then do it go full responsive, but for large companies i.e. eCommerce platforms and other such large platforms, try to evaluate the situation, if you can see a 100% reason not to go full responsive then don't, but instead of making a m.site I would make a app instead, have it redirect to the store and do it from there, because at that point it is fully built for the mobile experience, where as a mobile site, is a half way hack.

but this is just my opinion, others may think that making a site is great.