CSS not working
Unanswered
Bahama Swallow posted this in #help-forum
Bahama SwallowOP
I styled my page using CSS, but it doesn't load inside my routes and components
32 Replies
Masai Lion
you have already ./global.css
@Bahama Swallow
if you arent using tailwind, you need to actually add your classes to the html. it wont just “pick it upâ€
Bahama SwallowOP
yes
Masai Lion
I think you can not import all css two time
Bahama SwallowOP
serious ? how do i do that, it's the same as the documentation, do i have to import the css in every page and style it?
Masai Lion
do
import styles from "@/styles/your-css.css"
like this you can do
className={styles.theName}
Bahama SwallowOP
ok, i try it now, thanks @Masai Lion
Masai Lion
your welcome
ask if you can't make it
Bahama SwallowOP
ok
Is that because I'm not styling the routes or is there something wrong?
so there is no error
import '@/styles/global.css'
but i cant' use
classname={styles.theName}
Masai Lion
ok so
globla.css you do not touch it
its de css of all your pages
if you want to create a css only for one page
i recomend you to create a folder named styles and to pout all your css in there
and you import it like you did but with the name of the css
like this
Bahama SwallowOP
so i created a css and i have to import in every page? I tried to create a css file for each page and import it as styles, but it gave an error, even though I followed Next's documentation
Masai Lion
do you wanna voc ? hhaha
Bahama SwallowOP
i don't understand what is voc, sorry hahahahha
Masai Lion
vocal chat haha
Bahama SwallowOP
ok, may be tomorrow ?
Masai Lion
okay
Bahama SwallowOP
deal bro