【问题标题】:CSS Screen Resolutions for multiple devices [closed]多个设备的 CSS 屏幕分辨率 [关闭]
【发布时间】:2015-12-01 17:25:20
【问题描述】:

刚刚创建了我的商业网站,并上线调试测试。像往常一样,我假设。我的导航、正文和页脚会根据使用的设备进行调整。

我希望有一个简单的解决方法可以为每个设备创建屏幕调整,但我不知道该怎么做。我查到的信息都显示了不同的东西。

有人可以帮助我如何实现代码来调整每个屏幕的分辨率吗? (不同的电脑屏幕、移动设备 - iPhone 和三星、平板电脑等)

网址是:http://www.se7enservice.com

【问题讨论】:

  • 有太多的设备和屏幕尺寸只能选择一组数字并希望设计适合。更改屏幕尺寸,直到设计中断,并使用该 that 作为选择的媒体查询断点。可能是 945 像素,也可能是 865 像素,但这是您的设计……而不是设备。
  • 好吧,这就是我不确定的。谢谢
  • 不要引用其他网站,尤其是商业网站。好像您想发送垃圾邮件。
  • @peterh 对不起,如果我不清楚。该网站是我自己的商业网站。我发布它是为了证明当你查看其他设备时,尺寸是关闭的

标签: android html css windows macos


【解决方案1】:
<style type="text/css">
    /* default styles here for older browsers. 
       I tend to go for a 600px - 960px width max but using percentages
    */
    @media only screen and (min-width:960px){
        /* styles for browsers larger than 960px; */
    }
    @media only screen and (min-width:1440px){
        /* styles for browsers larger than 1440px; */
    }
    @media only screen and (min-width:2000px){
        /* for sumo sized (mac) screens */
    }
    @media only screen and (max-device-width:480px){
       /* styles for mobile browsers smaller than 480px; (iPhone) */
    }
    @media only screen and (device-width:768px){
       /* default iPad screens */
    }
    /* different techniques for iPad screening */
    @media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:portrait) {
      /* For portrait layouts only */
    }

    @media only screen and (min-device-width: 481px) and (max-device-width: 1024px) and (orientation:landscape) {
      /* For landscape layouts only */
    }
</style>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多