浮动导航栏按钮的权利

浮动导航栏按钮的权利

本文介绍了Bootstrap - 浮动导航栏按钮的权利的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用引导栏导航栏,但我想将其中一个按钮向右而不是左移,因为它已经是了。这里是HTML:

I'm using the bootstrap navigation bar, but I want to float one of the buttons to the right instead of the left as it already is. Here's the HTML:

    <div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
  <div class="container">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Project name</a>
    </div>
    <div class="collapse navbar-collapse">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Home</a></li>
        <li><a href="#about">About</a></li>
        <li><a href="#contact" class="navbar-nav pull-right">Contact</a></li>
      </ul>
    </div>
  </div>
</div>

我试过使用 nav navbar-nav navbar-right float:right 拉右。我真的不知道我还能做什么。任何帮助表示赞赏。

I've tried using nav navbar-nav navbar-right, float:right, and pull-right. I really don't know what else I could do. Any help is appreciated.

推荐答案

为该列表项目创建一个单独的 ul.nav code> ul right。

Create a separate ul.nav for just that list item and float that ul right.

这篇关于Bootstrap - 浮动导航栏按钮的权利的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 02:17