Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Add A Class In React

/*App.jsx*/

import React from 'react';

export function App(props) {
  return (
    <div className='App'>
      <h1 className="someClass">Hello React.</h1>
      <h2>Start editing to see some magic happen!</h2>
    </div>
  );
}
 /*style.css*/
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  background-color: #18222d;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.App {
  color: #72a24d;
}
.someClass
{
  color: red;
}

 
PREVIOUS NEXT
Tagged: #Add #A #Class #In #React
ADD COMMENT
Topic
Name
9+2 =