- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
为响应式设计编写代码时,智能手机和平板电脑的标准宽度是多少。我查看了不同的网站,但似乎没有找到任何标准宽度的好模板。你们在编写响应式设计时通常会为断点/媒体查询做什么?
如果有人有平板电脑/智能手机等不同结果的好模板,请分享!谢谢!
最佳答案
有两种方式来思考你的 CSS 媒体查询。
第一个是“桌面优先”。这意味着您的基础 CSS 将针对大屏幕,然后您的媒体查询将覆盖您的类以适应较小的类。你的 CSS 可以是这样的:
/* Large screens ----------- */
/*some CSS*/
/* Desktops and laptops ----------- */
@media only screen and (max-width : 1824px) {...}
/* iPads (landscape) ----------- */
@media only screen and (max-width : 1224px) {...}
/* iPads (portrait) ----------- */
@media only screen and (max-width : 1024px) {...}
/* Smartphones (landscape) ----------- */
@media only screen and (max-width : 768px) {...}
/* Big smartphones (portrait) (ie: Galaxy 3 has 360)*/
@media only screen and (max-width : 640px) {...}
/* Smartphones (portrait) (ie: Galaxy 1) */
@media only screen and (max-width : 321px) {...}
/* Smartphones (portrait) ----------- */
/* Ipad2 (portrait) ----------- */
@media only screen and (min-width : 768px){...}
/* Ipad2 (paysage) ----------- */
@media only screen and (min-width : 1024px){...}
/* Ordi (Petit) ----------- */
@media only screen and (min-width : 1224px){...}
/* Desktops and laptops ----------- */
@media only screen and (min-width : 1824px){...}
关于responsive-design - 响应式设计 - 智能手机和平板电脑的标准断点/媒体查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20301680/
我的应用程序中有两个 Activity 。第一个 Activity 启动模式是 singleInstance,第二个 Activity 启动模式是 singleTask。我正在使用这些启动模式,因为我
据热心网友投稿,小米小爱触屏音箱Pro 8外观曝光,可以看到触控屏幕尺寸比较大,像是在音箱上“长”了一个平板。 从曝光的信息来看,小米小爱触屏音箱Pro 8具有白色的配色设计,下方有一个长
我有一张 table ,看起来像, VisitorId date deviceType 1 2018-12-11 mobile 2
今天下午,小米官方公布了小爱触屏音箱Pro 8,可以看到触控屏幕尺寸比较大,音箱上“长”了一个平板。据悉,小米小爱触屏音箱Pro 8具有白色的配色设计,下方有一个长条状的扬声器,上方带有一个尺寸比较
有没有办法检测是否使用手持浏览器(iOS/Android 手机/平板电脑)? 我尝试这样做的目的是让手持设备上的浏览器中的元素宽度减半,但这并没有什么不同。 width: 600px; @media
目前,Google Analytics for web 公开了一个设备类别字段,其离散值为mobile、tablet 和desktop。该界面还允许您更深入地了解它的具体设备。我想 Google 有某
我是一名优秀的程序员,十分优秀!