Center the nav in Twitter Bootstrap

前端 未结 8 2141
隐瞒了意图╮
隐瞒了意图╮ 2020-12-07 16:00

I want to be able to center the nav dead middle of a page and have it stayed centered in different resolutions. I don\'t want to use offsets to push it over or margin-left a

8条回答
  •  广开言路
    2020-12-07 16:15

    Possible duplicate of Modify twitter bootstrap navbar. I guess this is what you are looking for (copied):

    .navbar .nav,
    .navbar .nav > li {
      float:none;
      display:inline-block;
      *display:inline; /* ie7 fix */
      *zoom:1; /* hasLayout ie7 trigger */
      vertical-align: top;
    }
    
    .navbar-inner {
      text-align:center;
    }
    

    As stated in the linked answer, you should make a new class with these properties and add it to the nav div.

提交回复
热议问题