在折叠之前,bootstrap3导航菜单链接对齐

时间:2017-07-22 16:55:01

标签: twitter-bootstrap-3

我试图在引导带中弄清楚如何使用左对齐链接,右对齐链接,然后是可折叠链接。

Link###############################Link#CollapableLink

我尝试使用但没有工作

<div class=""nav navbar-nav navbar-right">
   <ul class="nav navbar-nav ">
    <li><a href="#about">Link</a></li>
  </ul>    
</div>

1 个答案:

答案 0 :(得分:0)

&#13;
&#13;
<!DOCTYPE html>
<html lang="en">
<head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</head>
<body>

<nav role="navigation" class="navbar navbar-inverse navbar-static-top">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
                <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="#">Company</a>
        </div>
        <div id="navbar" class="navbar-collapse collapse navbar-right">
            <ul class="nav navbar-nav">
                <li ><a href="#">Home</a></li>
                <li class="dropdown">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                     role="button" aria-haspopup="true" aria-expanded="false">
                     Menu <span class="caret"></span></a>
                    <ul class="dropdown-menu">
                        <li><a href="1">1</a></li>
                        <li><a href="#">2</a></li>

                    </ul>
                </li>
            </ul>
        </div>
</nav>
</body>
</html>
&#13;
&#13;
&#13;