Reputation: 4439
I have the React/Next component below. I am trying to use a stylesheet to make it look better but for some reason the css is not being applied.
What do I do to fix this? I tried calling the stylesheet in pages/index.js and/or pages/_app.js but nothing changed.
Upvotes: 1
Views: 1941
Reputation: 2338
Please review the docs for css modules: https://nextjs.org/docs/basic-features/built-in-css-support#adding-component-level-css
Adjust your import:
import styles from '../../styles/ComponentName.module.css'
Then use use it like:
<div class={styles.classname}/>
Upvotes: 0
Reputation: 387
That's not how CSS Modules works.
Try this:
import styles from '../../styles/Home.module.css';
...
const LoginUser = ({onChangeLoginForm, loginUser}) => {
return(
<div className={styles.container}>
...
Upvotes: 1
Reputation: 2110
You have a mistake on your code. <p>
tag has align attribute which doesn't exist.
Upvotes: 0