【问题标题】:Bootrap3 responsive navigation has stopped working on mobile & tablet screen sizeBootrap3 响应式导航已停止在移动设备和平板电脑屏幕尺寸上工作
【发布时间】:2014-04-29 19:27:40
【问题描述】:

我一直在使用 bootstrap3 创建一个网站,并且下拉菜单在正确的 CSS 样式下工作得非常好。我没有更改任何代码,但移动视图和平板电脑视图导航现在没有样式,仅显示在列表视图中 - 请参阅:http://creative-media.info/FatLossPro/

我不确定这是怎么发生的;我没有修改代码并恢复到上一个​​工作副本。导航在过去 2 周内一直运行良好。我还重新上传了 JS 文件夹和 CSS 文件以及 function.php,以确保没有文件被错误保存、损坏或包含任何丢失的元素。

对于 wordpress 中这个 bootstrap3 导航问题的任何帮助将不胜感激(平板电脑和移动设备视图不再工作 - 没有 CSS 样式)

【问题讨论】:

    标签: javascript css wordpress twitter-bootstrap-3


    【解决方案1】:

    喜欢这个媒体查询。

    /* Smartphones (portrait and landscape) ----------- */
    @media only screen
    and (min-width : 320px)
    and (max-width : 480px) {
    /* Styles */
    }
    
    /* Smartphones (landscape) ----------- */
    @media only screen
    and (min-width : 321px) {
    /* Styles */
    }
    
    /* Smartphones (portrait) ----------- */
    @media only screen
    and (max-width : 320px) {
    /* Styles */
    }
    
    /* iPads (portrait and landscape) ----------- */
    @media only screen
    and (min-width : 768px)
    and (max-width : 1024px) {
    /* Styles */
    }
    
    /* iPads (landscape) ----------- */
    @media only screen
    and (min-width : 768px)
    and (max-width : 1024px)
    and (orientation : landscape) {
    /* Styles */
    }
    
    /* iPads (portrait) ----------- */
    @media only screen
    and (min-width : 768px)
    and (max-width : 1024px)
    and (orientation : portrait) {
    /* Styles */
    }
    
    /* Desktops and laptops ----------- */
    @media only screen
    and (min-width : 1224px) {
    /* Styles */
    }
    
    /* Large screens ----------- */
    @media only screen
    and (min-width : 1824px) {
    /* Styles */
    }
    
    /* iPhone 4 ----------- */
    @media
    only screen and (-webkit-min-device-pixel-ratio : 1.5),
    only screen and (min-device-pixel-ratio : 1.5) {
    /* Styles */
    }
    

    【讨论】:

    • 您好 Piyush,感谢您提供有关媒体查询的信息,我已经通过引导主题将这些设置到位,并且菜单在各种尺寸下都可以正常工作:移动设备、平板电脑和台式机。问题是它不再起作用了?我一直在检查 bootstrap.css 中的代码与使用原始主题下载的未经编辑的 css 文件,并且看不到任何已删除的代码块,这会导致它停止工作?
    • 好的。给我你的网址。
    • ttp://www.creative-media.info/FatLossPro
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-12-09
    • 1970-01-01
    • 2020-01-26
    • 2015-01-17
    • 1970-01-01
    • 2021-11-24
    相关资源
    最近更新 更多