gpt4 book ai didi

html - 在 div 中对齐导航栏

转载 作者:太空宇宙 更新时间:2023-11-04 13:13:51 24 4
gpt4 key购买 nike

请看这个:http://83.212.101.132/betdk/home/two

  • 当用户滚动时,导航栏会转到顶部(使用 affix 插件)。

  • 但是,它占据了整行(“Home”在左边)。

我应该怎么做才能让它:

  • 保留全 Angular 蓝色背景
  • 内容保持居中

这是词缀相关的 CSS:

        .affix {
position: fixed;

top: 0;
width: 100%;
left:0;
z-index:10;
box-shadow: 0 0 30px black;
-webkit-border-radius: 0 !important;
-moz-border-radius: 0 !important;
border-radius: 0 !important;

}

.affix .subcon {
/* The wrapper around the navbar contents */
}

有什么想法吗?


更新

Unykvis 的回答 确实有效。

添加一个(以避免弄乱原始形式的导航栏内容)

.navbar .container {
padding-left:0px;padding-right:47px
}
.navbar.affix .container {
padding-left:15px;padding-right:15px;
}

最佳答案

只需在菜单周围添加一个 .container div:

<div class="navbar-collapse collapse" id="navbar-main" style="padding-left:0; ">
<div class="container">
<ul class="nav navbar-nav">

这就是你想要的,对吗?

This is what you want, correct?

那么这样做:

Solved

编辑

为了修复食物,我会做:

<div id="nav-fixed" class="container">

并通过 jQuery 从“container-fluid”更改为“container”,当它正常时,它必须是流体,当它附加时它必须是容器。

关于html - 在 div 中对齐导航栏,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24508740/

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