简体   繁体   中英

Angular: child routes using RouterLinkActive not working

Something that should be 'easy' takes me already more than one hour... And I'm pretty stuck now. I just want to add a 'red' color when the 'child' router link becomes 'active'. See the link below:

https://stackblitz.com/edit/angular-pm9tdb

What am I doing wrong?

The link has its own color defined, which takes precedence over the color of its ancestor class. So your selector should be

.active a

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