Import css in react js

Import css in react js

const Header = () => {
  return (
    <>
      <h1 style={{backgroundColor: "lightblue"}}>Hello Style!</h1>
      <p>Add a little style!</p>
    </>
  );
}
const Header = () => {
  const myStyle = {
    color: "white",
    backgroundColor: "DodgerBlue",
    padding: "10px",
    fontFamily: "Sans-Serif"
  };
  return (
    <>
      <h1 style={myStyle}>Hello Style!</h1>
      <p>Add a little style!</p>
    </>
  );
}
import styles from './my-style.module.css'; 

const myStyle = {
 color: "orange", backgroundColor: "pink", }; const newCssObj = { newcss : { color:'yellow' } } const Car = () => {
  return <h1 className="app" style={newCssObj.newcss}>Hello Car!</h1>;
}

export default Car;

Leave a Reply