I am developing an Angular 4 application and want to apply some global styles. Following the instructions on the corner site , I created the "styles.css" file in the root directory of my application, and I refer to this stylesheet in the index.html of my application:
<link rel="stylesheet" type="text/css" href="styles.css">
Corner application successfully compiled:
$ ng serve
** NG Live Development Server is listening on localhost:4200, open your browser on http:
[...]
webpack: Compiled successfully.
But when I go to http: // localhost: 4200 in the Chromium browser, an error message is displayed on the console
GET http://localhost:4200/styles.css
In Firefox, the error is a bit more obvious:
GET
http://localhost:4200/styles.css [HTTP/1.1 404 Not Found 15ms]
The resource from "http://localhost:4200/styles.css" was blocked due to MIME type mismatch (X-Content-Type-Options: nosniff).
Both files, index.html and styles.css, are in the root directory of my angular application. I tried to get more information about the problem :
nosniff
Blocks a request if the requested type is
"style" and the MIME type is not "text/css", or
"script" and the MIME type is not a JavaScript MIME type.
, , type="text/css" .