Add transition to navbar bootstrap

Viewed 22

i have the follow code, and i want to add transition at the moment of click the link "Documentos" i dont know how to do it

<div class="collapse navbar-collapse" id="navbarTogglerDemo02" [ngbCollapse]="isCollapsed">
  <ul class="navbar-nav mr-auto mt-2 mt-lg-0" *ngIf="auth.isLogued()">
    <li class="nav-item" ngbDropdown *ngIf="(Role('75') || Role('106') || Role('76') || Role('124') || Role('111') || Role('112') || Role('113'))">
      <a class="nav-link" tabindex="0" ngbDropdownToggle id="navbarDropdown1" role="button">
        Documentos
      </a>
      <div ngbDropdownMenu aria-labelledby="navbarDropdown1" class="dropdown-menu">
        <a ngbDropdownItem routerLink="/VisorImagenes" [hidden]="!Role('75')">Visor de
          Imagenes</a>
        <a ngbDropdownItem routerLink="/Informatizar" [hidden] = "!Role('106')" >Informatizar</a>
        <a ngbDropdownItem routerLink="/BuscarReferenciacion" [hidden] = "!Role('76')">Buscar Referenciacion</a>
        <a ngbDropdownItem routerLink="/Digitalizar" [hidden] = "!Role('111')">Digitalizar</a>
        <a ngbDropdownItem routerLink="/SubirDigitalizacion" [hidden] = "!Role('112')">Subir
          Digitalizacion</a>
        <a ngbDropdownItem routerLink="/SubirImagenes" [hidden] = "!Role('113')">Subir Imagenes</a>
        <a ngbDropdownItem routerLink="/ImagenReferenciacion" [hidden] = "!Role('124')">Imagenes
          Referenciacion</a>
        <a ngbDropdownItem routerLink="/SubirRefeGeneral" [hidden] = "!Role('124')">Subir Referenciación General</a>
        <a ngbDropdownItem routerLink="/SubirBajarArchivos" [hidden]="!Role('138') || !Role('137')">Subir y Descargar Archivos</a>
      </div>
    </li>
  </ul>  
1 Answers

Add a class to the links you want, then with CSS to can add your style to:

.link-class:hover{color: red} or .link-class:active{color: red}

then the transition can go in

.link-class{transition: color 1s}

Check out https://www.w3schools.com/css/css3_transitions.asp for better explanation.

Related