gpt4 book ai didi

html - 如何在导航栏右侧使用偏移量

转载 作者:太空宇宙 更新时间:2023-11-04 10:59:07 25 4
gpt4 key购买 nike

我是 bootstrap 的新手。我有代码:

<header class="container">
<div class="navbar navbar-default navbar-fixed-top">
<div class="navbar-header"> <a href="." class="navbar-brand">Brand</a>
</div>
<!--<ul class="nav navbar-nav navbar-right">-->
<ul class="nav navbar-nav pull-right">
<li class="nav"><a href=".">Item 1</a>
</li>
<li class="nav"><a href=".">Item 2</a>
</li>
<li class="nav"><a href=".">Item 3</a>
</li>
</ul>

</div>
</header>

所以我想使用 navbar-right,但我也想使用 offset (2) from right。

现在是:

BRAND x x x x x x x x Item1 Item2 Item3

我想收到:

BRAND x x x x x x Item1 Item2 Item3 x x

在线演示:http://jsfiddle.net/7LcLE/

最佳答案

<body>

<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">WebSiteName</a>
</div>
<div>
<ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li>
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">Page 1 <span class="caret"></span></a>
<ul class="dropdown-menu">
<li><a href="#">Page 1-1</a></li>
<li><a href="#">Page 1-2</a></li>
<li><a href="#">Page 1-3</a></li>
</ul>
</li>
<li><a href="#">Page 2</a></li>
<li><a href="#">Page 3</a></li>
</ul>
<ul class="nav navbar-nav navbar-right" style="margin-right:10%;">
<li><a href="#"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
<li><a href="#"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
</ul>
</div>
</div>
</nav>

<div class="container">
<h3>Right Aligned Navbar</h3>
<p>The .navbar-right class is used to right-align navigation bar buttons.</p>
</div>

</body>

关于html - 如何在导航栏右侧使用偏移量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34475265/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com