通过 Bootstrap 导航栏。如何在移动或平板模式下将 NavBar 的组件放在右侧而不是左侧?

Posted

技术标签:

【中文标题】通过 Bootstrap 导航栏。如何在移动或平板模式下将 NavBar 的组件放在右侧而不是左侧?【英文标题】:Navigation Bar through Bootstrap. How to get the components of the NavBar on the right rather than left in mobile or tablet mode? 【发布时间】:2021-07-31 07:04:55 【问题描述】:

我们如何将列表放在屏幕右侧,就在切换或汉堡图标的下方?

【问题讨论】:

【参考方案1】:

您应该添加以下 CSS:

#nav-link active
    display: flex;
    align-items: center;
    justify-content: right;

这应该将“navbar-nav ml-auto”div 中的所有元素对齐到右侧。

【讨论】:

ok!..所以这将显示切换下的元素,对吧??? 正确。这仅适用于“#nav-link active” div。

以上是关于通过 Bootstrap 导航栏。如何在移动或平板模式下将 NavBar 的组件放在右侧而不是左侧?的主要内容,如果未能解决你的问题,请参考以下文章

Bootstrap 左侧导航栏如何实现

React bootstrap - 如何在移动设备中制作高度为 100vh 的导航栏

Angular UI 和 Bootstrap:点击链接时折叠移动导航栏

当用户在菜单外单击时,如何关闭 Bootstrap 导航栏下拉菜单?

Bootstrap 导航栏

Bootstrap 3.0.0 导航垂直折叠响应