html - 无法证明导航中的内容位于 Bootstrap 4 中的品牌名称旁边

标签 html css

我希望使用 Bootstrap 将我的导航菜单放在我的品牌名称旁边。

这是我的代码:

<nav class="navbar-expand">
  <a class="navbar-brand" href="https://example.com" target="_blank">Brand</a>
  <nav class="nav justify-content-start">
      <a class="nav-link active" href="#">Home</a>
      <a class="nav-link" href="#">FAQ</a>
      <a class="nav-link" href="#">Download</a>
  </nav>
</nav>

我正在使用 navbar-expand 因为它会强制水平导航栏,即使在移动设备上也是如此,但它会将内容置于品牌名称下,这不是我想要的。感谢您的帮助!

最佳答案

将此添加到您的 CSS 中。希望这就是您要找的。谢谢

.navbar-expand{
  display:flex;
  align-items: center;}

关于html - 无法证明导航中的内容位于 Bootstrap 4 中的品牌名称旁边,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54413359/

相关文章:

javascript - 使用 SVG 图像边框制作交互式 Canvas

javascript - 如何使动态和静态内容居中?

javascript - ajax:本地服务器没有数据

python - 在Python中将图像转换为灰度

html - Bootstrap 导航栏品牌左边距不覆盖

html - 使用 HTML5/CSS3 的可编辑笔划文本

html - 使缩略图部分宽度匹配缩略图而不是 Twitter Bootstrap v3 中的标题内容

html - Bootstrap - 相对于父 col 的 col 大小

html - CSS - 计算减去动态图像高度的百分比

javascript - 第一周的事件在 FullCalendar 中呈现接近顶部