我去了 twitter bootstrap 主页并复制粘贴了下面的菜单:
.navbar.navbar-inverse.navbar-fixed-top
.navbar-inner
.container / I tried 'margin: 0 auto;' since nav is a display block item but with no luck
%button.btn.btn-navbar{"data-target" => ".nav-collapse", "data-toggle" => "collapse", :type => "button"}
%span.icon-bar
%span.icon-bar
%span.icon-bar
%a.brand{:href => "./index.html"} Bootstrap
.nav-collapse.collapse
%ul.nav
%li.active
%a{:href => "./index.html"} Home
%li
%a{:href => "./getting-started.html"} Get started
%li
%a{:href => "./scaffolding.html"} Scaffolding
%li
%a{:href => "./base-css.html"} Base CSS
%li
%a{:href => "./components.html"} Components
%li
%a{:href => "./javascript.html"} JavaScript
%li
%a{:href => "./customize.html"} Customize
但!我的项目没有像他们的那样居中,我尝试使用 safari 开发人员工具,但没有任何运气!
哪个元素负责垂直居中项目?
编辑:这里
编辑:这是我在 .container 元素的 Safari 工具中看到的: