【问题标题】:with bootstrap navbar on mobile & ipad在移动设备和 iPad 上使用引导导航栏
【发布时间】:2017-02-12 13:53:57
【问题描述】:

我一直在尝试让我的网站在移动设备和 iphone 5 上运行(在 iphone 6 上运行良好)。它可以在模拟器上运行,但在服务器上却不行。我的右边有大约 20 像素的边距。

it works fine on the web : anandandakhil.me

我在 stackoverflow 上查找了一些线程,但它们没有工作。

其中一个是@media(max-width:768px)

我尝试将它附加到类 navbar , navbar-collapse

这是代码

index.html

切换导航
  • 首页
  • 关于
  • 投资组合
  • 取得联系
  • style.css

    #navbar-header.navbar-default {
        font-size: 16px;
        background-color: rgba(255, 255, 255, 1);
        border-bottom-width: 1px;
    }
    #navbar-header.navbar-default .navbar-nav>li>a {
        color: rgba(119, 119, 119, 1);
        background-color: rgba(255, 255, 255, 1);
    }
    #navbar-header.navbar-default .navbar-nav>li>a:hover,
    #navbar-header.navbar-default .navbar-nav>li>a:focus {
        color: #f28500;
        background-color: rgba(255, 255, 255, 1);
    }
    #navbar-header.navbar-default .navbar-nav>.active>a,
    #navbar-header.navbar-default .navbar-nav>.active>a:hover,
    #navbar-header.navbar-default .navbar-nav>.active>a:focus {
        color: #f28500;
        background-color: #fff;
    }
    @media(max-width:768px) {
    #navbar-header.navbar-default .navbar-toggle {
        border-color: #f28500;
    }
    #navbar-header.navbar-default .navbar-toggle:hover,
    #navbar-header.navbar-default .navbar-toggle:focus {
        background-color: #ffffff;
    }
    #navbar-header.navbar-default .navbar-toggle .icon-bar {
        background-color: #f28500;
    }
    #navbar-header.navbar-default .navbar-toggle:hover .icon-bar,
    #navbar-header.navbar-default .navbar-toggle:focus .icon-bar {
        background-color: #f28500;
    }
    }
    

    【问题讨论】:

      标签: css html twitter-bootstrap mobile navbar


      【解决方案1】:

      我也在使用 Bootstrap。

      据我所知,手机的屏幕分辨率和css分辨率是不一样的。例如 iPhone 5 的屏幕分辨率为 640x1136,但 css 分辨率为 320x568。

      【讨论】:

      • 如何让它正确显示?
      猜你喜欢
      • 2019-05-04
      • 2016-09-02
      • 1970-01-01
      • 2023-03-07
      • 1970-01-01
      • 2021-04-11
      • 1970-01-01
      • 2018-09-29
      • 1970-01-01
      相关资源
      最近更新 更多