U
U
undefined2019-09-14 12:08:02
css
undefined, 2019-09-14 12:08:02

Doesn't include .css, Mime type error?

Error - Refused to apply style from ' localhost:3000/css/index.css ' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
File structure:

-html
--main.html//link rel="stylesheet" type="text/css" href="../css/main.css"
-css 
--main.css

I collect through gulp'e I use normalize.scss, I read that this may be due to comments at the beginning of .css, but I think this is nonsense.
When I make sure that .ccs and .html are in the same folder, and I write the path directly (href='main.css'), it works, but I don't want to use such a structure, help please))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
U
undefined, 2019-09-14
@2Machiavelli

I did it, on the advice of a friend, I simply transferred .html to one directory above, and registered the path /css/main.css and it all worked.

G
gataylo, 2021-01-11
@gataylo

Stas Schmidt
Hello!
I've been struggling with the same problem for an hour, but all in vain. Need help plz.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question