0
How to file css With html I will link, I will link, but the command css I hit on html It doesn't work
6 ответов
+ 1
How can we know what your code looks like?
+ 2
Please don't post duplicated question, if you didn't get answer, just wait and help us by giving more info and showing code..
Your code inside css is invalid, and this is probably only reason why it does not work.
We can't nest style selectors.
For this you can use css preprocessors like sass or less.
So change your code to:
p {
color: red;
}
Inside sololearn, we don't have to link css it is automatically linked.
But if this does not help you then it can be because path to css is not right.
Tell us more about project structure, where do you define html file and where is your css file. With this info we can check is your path good or not.
Right now it should select css file if it is located inside same folder as html, and make sure file is named same and it is .css not .css.txt sometimes when we save code(without using coding editor, or by clicking auto save) it is saved as text file
+ 1
Can we first know for code
0
Help me please 🥺
0
In your CSS file, remove the body and it will run correctly. In your html file, you didn't add <body>, but you added it in the CSS. Perhaps you confused it!
So, the correct code in CSS should read:
p }
color: red;
}
Good luck!