gpt4 book ai didi

html - Bootstrap 导航栏如何给它一个最大宽度

转载 作者:行者123 更新时间:2023-11-28 12:54:43 26 4
gpt4 key购买 nike

我无法让它工作。

我有一个导航栏

<div class="container">
<div class="navbar">
<div class="navbar-inner">
<div class="pull-right">
<button class="btn btn-small btn-primary">Nieuwe medewerker</button>
</div>
</div>
</div>
</div>

现在这是一个很好的条形宽度,与容器的宽度相同,它居中于中间,正是我想要的。

现在我希望这个确切的栏固定在底部,但是当我添加 navbar-fixed-bottom 时,它会自动拉伸(stretch)到我的窗口大小。

<div class="navbar navbar-fixed-bottom">

我一直在尝试调整 css,但无法使其正常工作。有人知道如何做到这一点。

谢谢

最佳答案

navbar-fixed-bottom 使用 position:fixed 因此它从页面流中移除并且不再占用其容器的宽度。

您可以创建另一个类(即:navbar-bottom)并使用绝对位置将其放在底部...

.navbar-bottom {
position:absolute;
bottom:0;
width:90%;
margin-bottom:0;
}

演示:http://www.bootply.com/126172

关于html - Bootstrap 导航栏如何给它一个最大宽度,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22762322/

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