CSS3 媒体查询移动设备尺寸 Media Queries for Standard Devices (包括 苹果手表 apple watch)
- /* ----------- iPhone 4 and 4S ----------- */
- /* Portrait and Landscape */
- @media only screen
- and (min-device-width: 320px)
- and (max-device-width: 480px)
- and (-webkit-min-device-pixel-ratio: 2) {
- }
- /* Portrait */
- @media only screen
- and (min-device-width: 320px)
- and (max-device-width: 480px)
- and (-webkit-min-device-pixel-ratio: 2)
- and (orientation: portrait) {
- }
- /* Landscape */
- @media only screen
- and (min-device-width: 320px)
- and (max-device-width: 480px)
- and (-webkit-min-device-pixel-ratio: 2)
- and (orientation: landscape) {
- }
- /* ----------- iPhone 5 and 5S ----------- */
- /* Portrait and Landscape */
- @media only screen
- and (min-device-width: 320px)
- and (max-device-width: 568px)
- and (-webkit-min-device-pixel-ratio: 2) {
- }
- /* Portrait */
- @media only screen
- and (min-device-width: 320px)
- and (max-device-width: 568px)
- and (-webkit-min-device-pixel-ratio: 2)
- and (orientation: portrait) {
- }
- /* Landscape */
- @media only screen
- and (min-device-width: 320px)
- and (max-device-width: 568px)
- and (-webkit-min-device-pixel-ratio: 2)
- and (orientation: landscape) {
- }
- /* ----------- iPhone 6 ----------- */
- /* Portrait and Landscape */
- @media only screen
- and (min-device-width: 375px)
- and (max-device-width: 667px)
- and (-webkit-min-device-pixel-ratio: 2) {
- }
- /* Portrait */
- @media only screen
- and (min-device-width: 375px)
- and (max-device-width: 667px)
- and (-webkit-min-device-pixel-ratio: 2)
- and (orientation: portrait) {
- }
- /* Landscape */
- @media only screen
- and (min-device-width: 375px)
- and (max-device-width: 667px)
- and (-webkit-min-device-pixel-ratio: 2)
- and (orientation: landscape) {
- }
- /* ----------- iPhone 6+ ----------- */
- /* Portrait and Landscape */
- @media only screen
- and (min-device-width: 414px)
- and (max-device-width: 736px)
- and (-webkit-min-device-pixel-ratio: 3) {
- }
- /* Portrait */
- @media only screen
- and (min-device-width: 414px)
- and (max-device-width: 736px)
- and (-webkit-min-device-pixel-ratio: 3)
- and (orientation: portrait) {
- }
- /* Landscape */
- @media only screen
- and (min-device-width: 414px)
- and (max-device-width: 736px)
- and (-webkit-min-device-pixel-ratio: 3)
- and (orientation: landscape) {
- }
b) Galaxy Phones
- /* ----------- Galaxy S3 ----------- */
- /* Portrait and Landscape */
- @media screen
- and (device-width: 320px)
- and (device-height: 640px)
- and (-webkit-device-pixel-ratio: 2) {
- }
- /* Portrait */
- @media screen
- and (device-width: 320px)
- and (device-height: 640px)
- and (-webkit-device-pixel-ratio: 2)
- and (orientation: portrait) {
- }
- /* Landscape */
- @media screen
- and (device-width: 320px)
- and (device-height: 640px)
- and (-webkit-device-pixel-ratio: 2)
- and (orientation: landscape) {
- }
- /* ----------- Galaxy S4 ----------- */
- /* Portrait and Landscape */
- @media screen
- and (device-width: 320px)
- and (device-height: 640px)
- and (-webkit-device-pixel-ratio: 3) {
- }
- /* Portrait */
- @media screen
- and (device-width: 320px)
- and (device-height: 640px)
- and (-webkit-device-pixel-ratio: 3)
- and (orientation: portrait) {
- }
- /* Landscape */
- @media screen
- and (device-width: 320px)
- and (device-height: 640px)
- and (-webkit-device-pixel-ratio: 3)
- and (orientation: landscape) {
- }
- /* ----------- Galaxy S5 ----------- */
- /* Portrait and Landscape */
- @media screen
- and (device-width: 360px)
- and (device-height: 640px)
- and (-webkit-device-pixel-ratio: 3) {
- }
- /* Portrait */
- @media screen
- and (device-width: 360px)
- and (device-height: 640px)
- and (-webkit-device-pixel-ratio: 3)
- and (orientation: portrait) {
- }
- /* Landscape */
- @media screen
- and (device-width: 360px)
- and (device-height: 640px)
- and (-webkit-device-pixel-ratio: 3)
- and (orientation: landscape) {
- }
c) HTC Phones
- /* ----------- HTC One ----------- */
- /* Portrait and Landscape */
- @media screen
- and (device-width: 360px)
- and (device-height: 640px)
- and (-webkit-device-pixel-ratio: 3) {
- }
- /* Portrait */
- @media screen
- and (device-width: 360px)
- and (device-height: 640px)
- and (-webkit-device-pixel-ratio: 3)
- and (orientation: portrait) {
- }
- /* Landscape */
- @media screen
- and (device-width: 360px)
- and (device-height: 640px)
- and (-webkit-device-pixel-ratio: 3)
- and (orientation: landscape) {
- }
2. Tablets
a) iPads
- /* ----------- iPad mini ----------- */
- /* Portrait and Landscape */
- @media only screen
- and (min-device-width: 768px)
- and (max-device-width: 1024px)
- and (-webkit-min-device-pixel-ratio: 1) {
- }
- /* Portrait */
- @media only screen
- and (min-device-width: 768px)
- and (max-device-width: 1024px)
- and (orientation: portrait)
- and (-webkit-min-device-pixel-ratio: 1) {
- }
- /* Landscape */
- @media only screen
- and (min-device-width: 768px)
- and (max-device-width: 1024px)
- and (orientation: landscape)
- and (-webkit-min-device-pixel-ratio: 1) {
- }
- /* ----------- iPad 1 and 2 ----------- */
- /* Portrait and Landscape */
- @media only screen
- and (min-device-width: 768px)
- and (max-device-width: 1024px)
- and (-webkit-min-device-pixel-ratio: 1) {
- }
- /* Portrait */
- @media only screen
- and (min-device-width: 768px)
- and (max-device-width: 1024px)
- and (orientation: portrait)
- and (-webkit-min-device-pixel-ratio: 1) {
- }
- /* Landscape */
- @media only screen
- and (min-device-width: 768px)
- and (max-device-width: 1024px)
- and (orientation: landscape)
- and (-webkit-min-device-pixel-ratio: 1) {
- }
- /* ----------- iPad 3 and 4 ----------- */
- /* Portrait and Landscape */
- @media only screen
- and (min-device-width: 768px)
- and (max-device-width: 1024px)
- and (-webkit-min-device-pixel-ratio: 2) {
- }
- /* Portrait */
- @media only screen
- and (min-device-width: 768px)
- and (max-device-width: 1024px)
- and (orientation: portrait)
- and (-webkit-min-device-pixel-ratio: 2) {
- }
- /* Landscape */
- @media only screen
- and (min-device-width: 768px)
- and (max-device-width: 1024px)
- and (orientation: landscape)
- and (-webkit-min-device-pixel-ratio: 2) {
- }
b) Galaxy Tablets
- /* ----------- Galaxy Tab 10.1 ----------- */
- /* Portrait and Landscape */
- @media
- (min-device-width: 800px)
- and (max-device-width: 1280px) {
- }
- /* Portrait */
- @media
- (max-device-width: 800px)
- and (orientation: portrait) {
- }
- /* Landscape */
- @media
- (max-device-width: 1280px)
- and (orientation: landscape) {
- }
c) Nexus Tablets
- /* ----------- Asus Nexus 7 ----------- */
- /* Portrait and Landscape */
- @media screen
- and (device-width: 601px)
- and (device-height: 906px)
- and (-webkit-min-device-pixel-ratio: 1.331)
- and (-webkit-max-device-pixel-ratio: 1.332) {
- }
- /* Portrait */
- @media screen
- and (device-width: 601px)
- and (device-height: 906px)
- and (-webkit-min-device-pixel-ratio: 1.331)
- and (-webkit-max-device-pixel-ratio: 1.332)
- and (orientation: portrait) {
- }
- /* Landscape */
- @media screen
- and (device-width: 601px)
- and (device-height: 906px)
- and (-webkit-min-device-pixel-ratio: 1.331)
- and (-webkit-max-device-pixel-ratio: 1.332)
- and (orientation: landscape) {
- }
d) Kindle Fire
- /* ----------- Kindle Fire HD 7" ----------- */
- /* Portrait and Landscape */
- @media only screen
- and (min-device-width: 800px)
- and (max-device-width: 1280px)
- and (-webkit-min-device-pixel-ratio: 1.5) {
- }
- /* Portrait */
- @media only screen
- and (min-device-width: 800px)
- and (max-device-width: 1280px)
- and (-webkit-min-device-pixel-ratio: 1.5)
- and (orientation: portrait) {
- }
- /* Landscape */
- @media only screen
- and (min-device-width: 800px)
- and (max-device-width: 1280px)
- and (-webkit-min-device-pixel-ratio: 1.5)
- and (orientation: landscape) {
- }
- /* ----------- Kindle Fire HD 8.9" ----------- */
- /* Portrait and Landscape */
- @media only screen
- and (min-device-width: 1200px)
- and (max-device-width: 1600px)
- and (-webkit-min-device-pixel-ratio: 1.5) {
- }
- /* Portrait */
- @media only screen
- and (min-device-width: 1200px)
- and (max-device-width: 1600px)
- and (-webkit-min-device-pixel-ratio: 1.5)
- and (orientation: portrait) {
- }
- /* Landscape */
- @media only screen
- and (min-device-width: 1200px)
- and (max-device-width: 1600px)
- and (-webkit-min-device-pixel-ratio: 1.5)
- and (orientation: landscape) {
- }
3. Laptops
- /* ----------- Non-Retina Screens ----------- */
- @media screen
- and (min-device-width: 1200px)
- and (max-device-width: 1600px)
- and (-webkit-min-device-pixel-ratio: 1) {
- }
- /* ----------- Retina Screens ----------- */
- @media screen
- and (min-device-width: 1200px)
- and (max-device-width: 1600px)
- and (-webkit-min-device-pixel-ratio: 2)
- and (min-resolution: 192dpi) {
- }
4. Wearables
a) Apple Watch
- /* ----------- Apple Watch ----------- */
- @media
- (max-device-width: 42mm)
- and (min-device-width: 38mm) {
- }
b) Apple Watch
- /* ----------- Moto 360 Watch ----------- */
- @media
- (max-device-width: 218px)
- and (max-device-height: 281px) {
- }
参考:
- https://css-tricks.com/snippets/css/media-queries-for-standard-devices/
- CSS3: 移动端开发中 max-device-width 与 max-width 的区别
FannieGirl原创文章,想了解更多前端内容,关注我的博客园
https://www.cnblogs.com/ifannie/
转载务必声明出处哦~~~~更多操作,扣我
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 如何编写易于单元测试的代码
· 10年+ .NET Coder 心语,封装的思维:从隐藏、稳定开始理解其本质意义
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 周边上新:园子的第一款马克杯温暖上架
· Open-Sora 2.0 重磅开源!
· 分享 3 个 .NET 开源的文件压缩处理库,助力快速实现文件压缩解压功能!
· Ollama——大语言模型本地部署的极速利器
· DeepSeek如何颠覆传统软件测试?测试工程师会被淘汰吗?