Iphone 6+中的断点

Ma玛

我的响应式网格存在一些问题。这大概与我的断点有关。为了查看断点在Blisk浏览器中是否正常运行,我首先在字体上设置了颜色,然后就可以看到变化了。

之所以将第一个设置为414像素,是因为它可以在除Iphone 6+和Nexus 6之外的所有手机上运行。但是这些断点无法正常工作。标题文本不会更改颜色。

我在这里做错什么了吗?

@media only screen and (max-device-width : 414px) {

    .header-box {
    background-color: #163A4E;
    height: 550px;
    margin-bottom: 0px;
    padding: 0px;
    }

    .header-text h1 {
        color:red;
    }

    .header-text h2 {
        color:green;
    }
}

/* Iphone 6 + and Nexus 6*/
@media only screen and (min-device-width : 415px) and (max-device-width : 736px) and (orientation : portrait) { 
      .header-text h1 {
        color:yellow;
    }

    .header-text h2 {
        color:pink;
    }

}
罗恩·范德·海登

好吧,首先您要拥有,max-device-width但应该max-width因为device-width已弃用

另外,请勿使用,orientation因为尚不可用。

您的CSS如下所示:

@media only screen and (max-width : 414px) {

    .header-box {
    background-color: #163A4E;
    height: 550px;
    margin-bottom: 0px;
    padding: 0px;
    }

    .header-text h1 {
        color:red;
    }

    .header-text h2 {
        color:green;
    }
}

/* Iphone 6 + and Nexus 6*/
@media only screen and (min-width : 415px) and (max-width : 736px) { 
      .header-text h1 {
        color:yellow;
    }

    .header-text h2 {
        color:pink;
    }

}

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

iPhone 5和iPhone 6中的不同Int类型

iPhone无法在Xcode 6 Beta中连接

iPhone 6 Swift 4.2中的视频冻结

UITextField inputView在iPhone 6中不显示

XCode6中没有iPhone6或iPhone6 +模拟器

iPhone 6和6 Plus中的tableview约束

iPhone 6模拟器中的LaunchScreen与物理iPhone 6不同

更新的尺寸类别的xib在iPhone 6和iPhone 6 Plus中不显示iAd

在声明中调整iPhoneX / iPad / iPhone6的UIView位置

UIImage imageNamed未在iPhone6中设置图像

iPhone 6 Plus中的Safari剪切网页

iPhone5s和6中的TableView大小不同

如何在iPhone 6中使iFrame响应?

在iPhone 6中调用网络服务错误

在iPhone 6 / iOS 8中使用UIWebView旋转MPInlineVideoFullscreenViewController

如何在vb6中添加条件断点?

无法仅在Xcode 6中为iPhone 5和iPhone 4设计应用程序

iPhone6视图无法在iPhone5中正确显示

在iPhone iPhone 6 plus中,全角组件的左侧和右侧都有边距

如何在同一情节提要中缩放iPhone 5和iPhone 6屏幕?

如何在iPhone 6和iPhone 6plus的ios中删除Collection View Cell之间的空间?

UIView上的圆角仅在少数模拟器(例如iPhone8,iPhone6s,iPhone6s plus和iPhone 6)中不起作用

在iPhone 6和6 plus中设置背景图像和图标图像

关于Xcassets,全屏图像和iPhone 4、5、6和6+的段落中的明确答案

AVAudioPlayer在iPhone 6和6+中以很小的音量播放声音

UIImageview上的CAGradient层在iphone 6s plus中向上移动,同时在iphone 5中正确设置

对于iPhone 6和iPhone 6 +,setSelectionIndicatorImage的尺寸错误

仍未针对iPhone 6和iPhone 6 Plus优化

为什么我在iPhone5和iPhone6的模拟器中得到不同的布局