如何将导航栏项目精确居中?

发布于 01-21 03:44 字数 51 浏览 3 评论 0原文

基本上我的项目从中心开始,但我想要均匀分布,因此第一个项目不是从中心开始,而是稍微偏左。

Basically my items start at the center, but I want even distribution so the first item starts not in the center but a bit to the left.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

浪荡不羁2025-01-28 03:44:42

有些CS应该完成这项工作

.navbar.center .navbar-inner {
  text-align: center;
}

some css should do the job

.navbar.center .navbar-inner {
  text-align: center;
}
无法言说的痛2025-01-28 03:44:42

这是我能想到的一个最小的例子, https://jsfiddle.net/o8emug03/15/。

基本上,您必须使用 display: flex; justify-content: center; 在导航栏中,并附加您希望在其中显示的元素。

This is a minimal example I could come up with, https://jsfiddle.net/o8emug03/15/.

Basically, you have to use a display: flex; justify-content: center; in your navbar, and append the elements you wish to display inside.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文