TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Responsive layouts should not rely browser-window-size

5 点作者 nimz将近 12 年前
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 条评论

timmm将近 12 年前
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>
Throwadev将近 12 年前
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?
Ecko将近 12 年前
A mix of media queries and window size along with useragent can be a good choice alas it will be quite cody..!!!