0

I created a button, but the text is not really centered.

Picture of not centered button text:-

enter image description here

.navbar-toggler-icon {
    display: inline-block;
    width: 3.5em;
    
    vertical-align: middle;
    content: "";
    background: 50% / 100% 100% no-repeat;
}
<button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarNavDropdown" aria-controls="navbarNavDropdown" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon">Menu</span>
        </button>
Anurag Dabas
  • 23,866
  • 9
  • 21
  • 41
Mimi
  • 11
  • 4

1 Answers1

1

Can you please check the below code? Hope it will work for you. We have flex utility to solve your issue.

.navbar-toggler-icon {
  display: inline-flex;
  width: 3.5em;
  vertical-align: middle;
  content: "";
  background: 50% / 100% 100% no-repeat;
  align-items: center;
  -webkit-align-items: center;
  justify-content: center;
  -webkit-justify-content: center; 
}
Yudiz Solutions
  • 4,216
  • 2
  • 7
  • 21