Refused to apply style from because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled

Posted by

There may be several chances to get this error.

Solution 1:-

This error can also come up when you’re not referring to your CSS file properly.

For example, if your link tag is

<link rel="stylesheet" href="styles.css">

but your CSS file is named style.css (without the second s) then there is a good chance that you will see this error.

Solution 2:-

In addition to using:

<base href="/">

put above line into before your stylesheet link tag.

Then Remove the rel="stylesheet" part from your css links:

before:-

<link rel="stylesheet" type="text/css" href="assets/styles/style.css"/>

after:-

<link type="text/css" href="assets/styles/style.css"/>

Solution 3:-

change  href to src. So from this:

<link rel="stylesheet" href="styles/style.css">

to this:

<link rel="stylesheet" src="styles/style.css">

Hope any of the solutions works for you.

Thank you.

If you also wish to share your knowledge with the TheCodeSpace fam kindly share your thoughts/article on rajparmar2308@gmail.com.

VISIT  THECODESPACE  YOUTUBE CHANNEL :- THECODESPACE CHANNEL

Leave a Reply

Your email address will not be published. Required fields are marked *