Html routerLink选定选项颜色

Html routerLink选定选项颜色,html,css,angular,typescript,Html,Css,Angular,Typescript,我需要在所选链接上使用红色About <nav> <a routerLink="" routerLinkActive="active" [routerLinkActiveOptions]="{exact:true}">About</a> <a routerLink="product" routerLinkActive="active">Emp

我需要在所选链接上使用红色
About

<nav>
  <a routerLink="" routerLinkActive="active" [routerLinkActiveOptions]="{exact:true}">About</a>
  <a routerLink="product" routerLinkActive="active">Employees</a>
</nav>


我该怎么做?

routerLinkActive
属性接收css类。在您的例子中,
active
是css类。 因此,您只需在css文件中以这种方式声明类:

.active{
   color:red;
}