TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Responsive layouts should not rely browser-window-size

5 pointsby nimzalmost 12 years ago
Aggresive responsive layouts based only on browser-window-size are just not right. e.g. http:&#x2F;&#x2F;sethgodin.typepad.com&#x2F;.<p>Just because my window width is smaller than 768px doesn&#x27;t mean I&#x27;m using a tablet or smart-phone. I don&#x27;t always use the browser in full-screen. When I&#x27;m on my laptop, I almost always want to see the full-version of your website, not the smart-phone optimized one.<p>Once Retina screens are ubiquitous and browsers stop faking pixel sizes for Retina screens, 768px will be pretty tiny and you&#x27;re going have to go back change all your stylesheets to keep updating the size constraints.<p>The only possible solution to this today is using Javascript (only Firefox allows touch screen detection in CSS). It seems like http:&#x2F;&#x2F;modernizr.com&#x2F; is the best choice.<p>Can you suggest a better solution to avoid using browser-window-size to detect touch screens&#x2F;smaller-screens, preferably in CSS?

3 comments

timmmalmost 12 years ago
I just use a responsive design framework such as foundation.<p><a href="http://foundation.zurb.com/" rel="nofollow">http:&#x2F;&#x2F;foundation.zurb.com&#x2F;</a>
Throwadevalmost 12 years ago
Flagging this for later, as I&#x27;m curious to see the answers. Maybe it would be better to ask this on stackoverflow.com or one of the other stackexchange sites?
Eckoalmost 12 years ago
A mix of media queries and window size along with useragent can be a good choice alas it will be quite cody..!!!