Twitter bootstrap bootstrap 4导航栏仅适用于移动设备

Twitter bootstrap bootstrap 4导航栏仅适用于移动设备,twitter-bootstrap,bootstrap-4,Twitter Bootstrap,Bootstrap 4,我有这个(哈默): 只有在移动设备上(lglg)才可以使用引导功能使导航栏粘在顶部吗?您可以仅使用媒体查询强制导航栏粘在移动设备上的顶部 将“最大宽度”更改为所需的最大宽度 @media (max-width: 1200px) { body { margin-top: 50px; } .navbar{ position: fixed; right: 0; left: 0; border-radius: 0; top: 0;

我有这个(哈默):


只有在移动设备上(lglg)才可以使用引导功能使导航栏粘在顶部吗?

您可以仅使用媒体查询强制导航栏粘在移动设备上的顶部

将“最大宽度”更改为所需的最大宽度

@media (max-width: 1200px) {
  body {
    margin-top: 50px;
  }

  .navbar{
    position: fixed;
    right: 0;
    left: 0;   
    border-radius: 0;
    top: 0;
  }      
}

希望这能有所帮助。

谢谢,我必须定义z-index:2;在身体和z指数:1;到导航栏。但效果很好:)
@media (max-width: 1200px) {
  body {
    margin-top: 50px;
  }

  .navbar{
    position: fixed;
    right: 0;
    left: 0;   
    border-radius: 0;
    top: 0;
  }      
}