Skip to content Skip to sidebar Skip to footer

Why Custom Css Class Does Not Work On React-Semantic-UI Elements?

I created card with react-semantic-ui, I want to add some extra styles via css class. One example is: I add custom 'card' class with box-shadow property, and that style is not app

Solution 1:

Give your className a bit more specific name, like claim_Card. After that in your css you need to override sematic's default css by adding your className to existing semantic's css for that component. In your case it would be something like

.ui.card.claim_Card {
  background: #455332; //for example
}

This will give your css rule more specificity and will override default semantic css. Anyway, check in your browser inspector what css class is applied to your element that you want to style and use that className (in this case .ui.card) and add on it your className definition and rules.


Solution 2:

Since class is a keyword in JavaScript, you should use className instead of class in React.

<Card className='card'>

Post a Comment for "Why Custom Css Class Does Not Work On React-Semantic-UI Elements?"