Skip to content
Advertisement

How to change text color in React?

I have tried everything possible(inline, another CSS file you name it) but nothing seems to work.

I am trying to make a Navbar using React bootstrap.

This one: https://react-bootstrap.github.io/components/navbar/

Here’s my code:

JavaScript

I want to change it’s color from default to white.

Advertisement

Answer

Instead of <Nav.Link href="#link">Link</Nav.Link>

write

<Nav.Link href="#link"><h4 className="linkText">Link</h4></Nav.Link>

Followed by CSS

.linkText{ color: white ; }

User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement