无法在bootstrap导航中垂直居中非锚标签

时间:2018-03-07 22:03:07

标签: html css twitter-bootstrap twitter-bootstrap-3

我有一个自举顶部导航栏,以及导航中心内部的所有标签很好,但是我有一个图像,以及一个切换开关,我似乎无法垂直居中在导航中。我尝试了很多各种自定义css但没有运气。理想情况下,我想为此创建一个类,nav-center-ele。

type Item_List is record
   Total : natural;
   Names : Small_String_Array;
end record;

type Categories is (Days, Months, Seasons);

Items : array (Categories) of Item_List;

for Count_1 in Categories loop
  for Count_2 in 1 .. Items(Count_1).Total loop
      Put_Line (Items(Count_1).Names(Count_2));
  end loop;
end loop;

1 个答案:

答案 0 :(得分:1)

使用navbar-text类为其提供正确的垂直填充...

https://www.codeply.com/go/Z914uQtCSE

         <ul class="nav navbar-nav navbar-left">
                    <!--<li><a href="#!/home">home</a></li>-->
                    <li><a href="#!/foo">foo</a></li>
                    <li><a href="#!/bar">Bar</a></li>
                    <li class="navbar-text">
                    <!-- Rounded switch wont center!! -->
                        <label class="switch">
                            <input type="checkbox" id="darkModeSlider">
                            <span class="slider round nav-center-ele"></span>
                        </label>
                    </li>
         </ul>