gpt4 book ai didi

css - 将导航栏中的内容与 Bootstrap 中的位置中心对齐

转载 作者:行者123 更新时间:2023-11-28 13:00:18 25 4
gpt4 key购买 nike

我试了很多,还是无法修复导航栏中间的内容。但可以将其固定在左侧或右侧。以下是我使用的代码。

<h4 class="navbar-text navbar-center">Mytitle </h4>

最佳答案

试试这个 -> JSFIDDLE DEMO

首先,您必须删除 Bootstrap 的通用类。

我们通过重置 float:none 选项来做到这一点!

然后我们使用 text-align:center 将内容居中。

CSS:

#example .navbar .nav,
#example .navbar .nav > li
{
float:none; /*To remove the inbuilt float option*/
display:inline-block;
}

#example .navbar-inner {
text-align:center;/*To center this*/
}

.navbar .brand{
float:none; /*To remove the inbuilt float option*/
}

关于css - 将导航栏中的内容与 Bootstrap 中的位置中心对齐,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21477963/

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