You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the Link component to populate the links in my site's navbar. It's great that the react-router link component automatically gives the appropriate link the class active.
However I'd like to nest this anchor tag within an unordered list and list item - ul > li > a
And then style the li when the anchor is a.active to let the user know where they are in the site. Sadly CSS has no parent selector, so the alternative is to do some hacky javascript to set the li that's a parent of the a.active link.
great that works! Is there any way to get a # part of the url?
I have /,/#foo and /blog routes. The hash one is useful because it gets the browser to scroll directly to that section. Does this information ever reach the backend? if so any way to get it from the State mixin?
I'm using the Link component to populate the links in my site's navbar. It's great that the react-router link component automatically gives the appropriate link the class
active
.However I'd like to nest this anchor tag within an unordered list and list item -
ul > li > a
And then style the
li
when the anchor isa.active
to let the user know where they are in the site. Sadly CSS has no parent selector, so the alternative is to do some hacky javascript to set theli
that's a parent of thea.active
link.my code
produces
I'd like the first
li
to have a class ofactive
as well.could anyone advise on how to achieve my desired effect? I think navbars built around an unordered list is a common approach.
The text was updated successfully, but these errors were encountered: