A METHOD OF REFERENCING CSS IN JSX

step 1: create a new css file in the page or pages directory, such as style.css;

step 2: import the css file in the jsx page, for example:

import style from './style.css';

Step 3: Add the className attribute to the complex you need to decorate, for example:

className={style.sty1}

Step 4: Define the className property in the css file, for example:

sty1{color:red}

Leave a Reply