0
Currently I have a sidenav made with Angular Material.
I have a list with menu and submenus, and at the end I have a logo. My problem is that when all the menus inside my sidenav are opened, they end up colliding with my logo:
(I removed the visibility of menu items and logo)
The collision happens in the menu "Logs" and the logo.
I tried it in the following ways:
HTML:
<img id="logo" src="../../../assets/logo">
#logo{
width: 120px;
bottom: 0;
left: 0;
right: 0;
position: absolute;
margin: auto;
margin-bottom: 5%;
}
Currently works well if the menus are closed, my logo is positioned at the bottom of my sidenav, but if the user opens the menus collides with the menu "Logs".
I tried too:
#logo{
width: 120px;
bottom: 0;
left: 0;
display: flex;
right: 0;
/* position: absolute; */
margin: auto;
margin-bottom: 5%;
}
That way the menu doesn’t collide with the logo, but my logo isn’t centered at the end of my sidenav.
Is there any way my logo can be centered at the end of my sidenav without it being possible for it to collide with open menus?
HTML Completo:
<mat-sidenav-container hasBackdrop="false" class="container-sidenav">
<mat-sidenav [(opened)]="opened" #sidenav mode="over">
<mat-list>
<div class="container">
<div class="row">
<div class="col-3">
<div id="avatarDash" class=" pointerCursor">
<svg id="svgDash" class="svgIconeMenu" style="width:40px;height:40px" viewBox="0 0 24 24">
<path fill="rgb(161,196,66)" d="1,3H3V13H11V3M21,11H13V21H21V11M11,15H3V21H11V15Z" />
</svg>
</div>
</div>
<div class="col-9">
<div class="col-12 pointerCursor">
<span class="tipografiaDescricaoIcone">Menu 1</span>
</div>
</div>
</div>
<div id="menuCadastros">
<div (click)="changeMenuCadastros()" class="row">
<div class="col-3 colAtiva">
<div class="pointerCursor">
<svg class="svgIconeMenu"
xmlns="http://www.w3.org/2000/svg" width="37px" height="37px" viewBox="0 0 24 24">
<path d="M0 0h24v24H0z" fill="none"/>
<path d="M20.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V8h16v10z"/>
</svg>
</div>
</div>
<div class="col-6">
<span class="tipografiaDescricaoIcone">Cadastros</span>
</div>
<div class="col-3 pointerCursor">
<i class="fa fa-caret-down lightgray" aria-hidden="true"></i>
</div>
</div>
<div>
<div class="alinhaSideNav">
<span (click)="verificaPermissao(1,'operadores')" class="tipografianivel2 hover-effect">Operadores</span>
</div>
<div class="alinhaSideNav">
<span (click)="verificaPermissao(11,'transportadora')" class="tipografianivel2 hover-effect">Transportadoras</span>
</div>
</div>
</div>
<img id="logo" src="../../../assets/logo.png">
</mat-sidenav>
<mat-sidenav-content>
Dude you have to put the HTML ai tb. and if possible the entire code of the menu so that we can simulate your problem.... Only what you posted there is not to simulate your problem and give you a concrete answer. But in the version that is with flex try to put Justify-self: center; or Justify-content: center; to see if it resolves
– hugocsl
@hugocsl added the html
– veroneseComS
have tried with position Fixed?
– Marcos Henrique
yes, with position Fixed the menu continues colliding with the logo when opened
– veroneseComS