Hover/ pseudo-classes in React-Bootstrap issues

Viewed 81

UPDATE: FIXED :)

React-Bootstrap needs classes to be introduced or making the CSS more specific and introducing some spans for styling purposes. For example in this case, the way to go was:

CSS

a.text-white.nav-link span:hover {
  color: black;
}

NAV.LINK

<Nav.Link className="text-white" as={Link} to="/book">
   <span>Book</span>
</Nav.Link>


Old issue: I am trying to set some onHover properties on some React-Bootstrap elements but it is impossible if I don't mark them as !important in the CSS when I target their classnames. Initially I couldn't even change the colors for the texts below, but then I figured out the text-white R-B class exists. Do you have a suggestion on how to use :hover maybe as inline or in the CSS file but not as !important in order to have a black color as a hover effect on f.ex. "Find Booking" and "Book"? Thank you for your time :)

 <Navbar.Collapse id="basic-navbar-nav">
      <Nav className="ml-auto">
        <Nav.Link id="find" href="find" className="text-white">
          Find booking
        </Nav.Link>
0 Answers
Related