Bootstrap 4 center navbar brand with collapse

前端 未结 4 1843
暖寄归人
暖寄归人 2021-01-13 02:24

Bootstrap 4 Alpha 6

I cant seem to figure out how to get both the right links and left link to both collapse. Right now only the right hand side link collapses.

4条回答
  •  天命终不由人
    2021-01-13 03:06

    The code posted by ZimSystem will overlap the menu items due to having 100% width and might clash with click events etc. A better option would be to use left instead of width.

    .navbar-brand
      {
        display: block;
        left: 50%;
        position: absolute;
        text-align: center;
      }
    

提交回复
热议问题