0

I have a navbar menu with a few list items. I need even white space between them, and this is difficult for me since some list items are longer than others. enter image description here

I've looked at this question but it doesn't address my problem, though I did use it for centering and justifying the navbar.

Here is a bootply: http://www.bootply.com/UjY99PYpe7

Community
  • 1
  • 1
Rachel S
  • 3,780
  • 3
  • 24
  • 37

2 Answers2

2

Try this css in your bootply:

.navbar-nav {
    text-align: justify;
    min-width: 100%;
}
.navbar-nav:after {
    content: '';
    display: inline-block;
    width: 100%;
}
.navbar-nav li {
    display: inline-block;
    float:none;
}
2

If you wish your buttons to be full width

Try this flexbox solution

.navbar-nav {
  width: 100%; 
  display: flex;
  flex-wrap: no-wrap;
  justify-content: space-between;
}

.navbar-nav > li {
  flex-grow: 1;
  text-align: center;
}
Community
  • 1
  • 1
warkentien2
  • 969
  • 13
  • 20