简体   繁体   中英

Side Nav panel in Angular

I am trying add a button (to open the side panel), but for some reason it shows up on the top left of the page. I want it to appear on the middle (right side) so when the user clicks on it the panel displays. I also want the current content on the page to zoom in when the side panel opens so the user is able to see both panel and the current content.

descripition of what you want talk

  <div>
    <button mat-button (click)="left.open()">Field Definitions</button>
  </div>

what is the correct CSS to?

I believe you're looking for this , it's an example provided in the Angular Material Documentation.

There are several ways to position the sidenav toggle button, you can either use CSS Flexbox or just add float: right property to the button. I would choose the first method combined with the use of mat-toolbar .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM