score:3
Accepted answer
i just tried the code and it works
import react, { component } from 'react';
import logo from './logo.svg';
import './app.css';
class app extends component {
constructor(){
super()
}
render() {
return (
<div>
<div class="navbar-fixed">
<nav classname="navbar">
<div classname="nav-wrapper">
<a href="#" classname="brand-logo">udacity logo</a>
<ul id="nav-mobile" classname="right hide-on-med-and-down">
<li><a href="#">nanodegree</a></li>
<li><a href="#">hire talent</a></li>
<li><a href="#">for business</a></li>
<li><a classname="waves-effect waves-light btn findbtn">course finder</a></li>
</ul>
</div>
</nav>
</div>
</div>
);
}
}
export default app;
and in css file app.css you have to include
.findbtn{
background-color: #5e35b1;
}
/* if it does not work try with
background-color: #5e35b1 !important;
may there is some css that is overriding the values */
if it does not work try with !important tag in css may be there is some other class which is not allowing to apply your css
score:1
try following
a[classname='findbtn']{
background-color: #5e35b1;
}
score:1
you can try this:
.findbtn{
background-color: #5e35b1 !important;
}
if above example not working, use developer tools for check whether component sees your css code. maybe you forgot to require this css file.
Source: stackoverflow.com
Related Query
- How to change default button color in materialize css?
- How to change the default screen background color of all the pages in React JS(Next JS) using tailwind CSS
- How to change background color of react native button
- How to change color of fontawesome icons in modular css React
- Material-UI - How to change default color for dark theme?
- How to change react-bootstrap navbar-toggler-icon button and button color
- How to change the color of a active button only in react native
- React - How to replace the hover color of an Ant-Design Primary button with a css variable?
- How to change default width of Radio button in Material UI
- how to change the font color, font size, and button color in React
- How to dynamically change button size and color in React
- how to change the line color in the NavBar toggle button in react-bootstrap?
- How to change ant-design Tabs default border color
- How to change the background and text color within button using button onClick in React JS
- how to change background color when I click the button using react hooks
- How do I change the default background color of notistack in MUI v5?
- How to change background color of button using react
- how to use button as link in material-ui react with out underline and change color text?
- How do i change the color of a button when clicked in react?
- How to change Button Color onClick Material-UI, React
- How do I change the button color on click?
- how to change the background color of a button without affecting the other buttons in React JS
- How to individually change text color and font weight in the same div element using Tailwind CSS and React
- How to change the tui-color-picker default color using @toast-ui/react-image-editor?
- How to change color of button in material ui using "&:active":?
- How to change border color of radio button in Material-UI?
- How to change color button onclick react.js
- React JS How to change font color in element other than clicked button onClick?
- How to change button background color and text color using setSate in react?
- How to make button color change if button selected and unselected
More Query from same tag
- How to sum up data in the rendered component in react?
- React: Uncaught TypeError: Cannot read properties of undefined (reading '0')
- How do I clear the input field after an incorrect entry
- React Stateless Components: Interacting with their output and appearance
- Filter and Map over the same array in React
- AppBar can not get theme with material-ui V5 (Bug or Change in v5????)
- React-router + typescript type error
- My button needs to be clicked twice to render the new component for the first click React
- React list duplicate items
- Reactjs props is not working fine
- I can't deal with SSR React
- Call function on default when checkboxes are rendered
- Can I use both ES6 and ES5 in the same React codebase?
- How to align left for Item1 and align right for Item2 & Item3 with MUI React?
- Data not being fetched (React-redux)
- How to toggle a content of the single element in React JS?
- ' Jest encountered an unexpected token { ' error on react application
- How to format payload data to only contains data that corresponds with the specific section?
- How to trigger child element while clicking parent element on React?
- React: How to rerender a state again, that was changed once in componentDidMount lifecycle method?
- Access nested array value inside other array in the stateful ReactJS component
- continously add to an objects key value in javascript
- react-map-js popup won't close / remove
- Check all the values of an object then if the values is empty it will return what is the key of that empty value?
- why I am getting warning-Functions are not valid as a React child. .......?
- How do i set backgroundImage on a single component?
- How to configure Webpack 2.2.1? Error ... configuration object that does not match the API schema
- React; cannot read property of undefined inside render > return()
- How to update an object that is within an array
- setInterval does not in React Functional Component