Home > Net >  Align menu button to right
Align menu button to right

Time:12-14

I want to align the button to right side.

<div >
            <a href="#" >Logo</a>
            <button type="button"  (click)="collapsed=!collapsed">
                <span ></span>
            </button>
        </div>

Current alignment of menu bar

I have already tried using float on button but its not working.

CodePudding user response:

Give display: flex; width: 100%; to the parent and put this tag after your a tag:

<div style="flex-grow: 1"></div>

Should be like this:

<div  style="display: flex; width: 100%;">
  <a href="#" >Logo</a>
  <div style="flex-grow: 1"></div>
  <button type="button"  (click)="collapsed=!collapsed">
    <span ></span>
  </button>
</div>
  • Related