LLG
LLG

Reputation: 65

I cannot override the style of components from react ui library

I'm getting starting 'antd' which is a react ui library, with my react project.
The problem was to change the background color of antd's Header component. (white -> red)

The first thing I tried was to give a new className to the Header component and change the background color.
enter image description here enter image description here
But it didn't work.

The next thing I tried was to override the style using the className set by antd.
enter image description here
It didn't work either.

How can I change the style of this Header component?
I am not using the css methodology such as styled-components or css-module, and I do not want to use the 'important!' property, or inline styling.

Upvotes: 2

Views: 453

Answers (1)

Phat Vo
Phat Vo

Reputation: 54

You can increase CSS specificity. Example: div.my-class

Upvotes: 0

Related Questions