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.

I believe that media queries are the standard fare nowadays as it is much faster to implement and you have a great deal of control on where you want the break points. You can get browser addons to resize to what ever you ike to preview where your site breaks. Also i believe they look more pro as anyone can make 2 sites but to use the media queries show another level of understanding.

Thank you for your answer Adam Sackfield , I believe that too. But still some websites -Huge ones- such as Youtube and Facebook uses the old technique (To build two different websites with different Markup) that why I start this discussion to get some more ideas from different developers around the world.

As in my country, the idea of responsive websites still new for their minds and companies, the thing that kills me. But today I was asking myself how to convince people about getting red of using the m.mywebsite or the second version to meet the mobile screens or the small screens.

Thank you again for your answers and hoping to find more people would love to give us some other ideas.

Here is a link with some of the pro's and con's. Omar Zeidan do you use twitter if so you may add me @Sacki2013

I'm not entirely sure how accurate this is, but my guess is that for larger websites like Facebook, Youtube, and Amazon it's just not the time to make that change. They have a much broader audience than most medium/smaller websites. I think a lot of their decisions are made based on their own user base, like percentage of users using i.e. 6 or 7 vs more modern browsers and how/if those changes will hurt profits. So it just might not be in their best interest to make those changes quite yet.

It's also important to keep in mind that while fallback techniques are available, they require more lines of code and every kb counts when it comes to performance, especially on large websites. This also requires more manpower write all of the code, and upgrade the servers, which all cost more money. I'm sure they are well aware of current web trends, and standards. They are also more than capable of finding solutions and making changes, but really I think it just all boils down to money.

This is just a thought though, I'm not entirely sure.

Sorry if this isn't well written out but I'm short on time and will back later to elaborate more.

William Whitworth, That's pretty cool man, thank you so much for mentioning that, and absolutely they will refer to the percentage of using such old browsers and the audience needs, but do you think that there any other approach or way that they could use, such as making the website responsive but on IE6,7 they just make it fixed or using special css file for older browsers ?

1 Answer

Here are the two most common reasons when I do not use media queries:

  1. a client may want to add a mobile site to an existing desktop site
  2. the client wants a very custom design but does not want to pay the extra to mobilize it

Thank you Jeremy Germenis for your answer, and yes you are right, so you mean that you like and recommend using the media queries but you don`t use it just in the 2 cases you have just mentioned. Appreciated and thank you man :)