1

I have a problem with external css. When I have creating my project using html and css the css is working fine but when for some reasons I have change this

#LoadModule rewrite_module modules/mod_rewrite.so 

in httpd.conf file in apache

to this

LoadModule rewrite_module modules/mod_rewrite.so

my all the css are not working properly and one more thing is that when I have checked the console

Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost/E-commerce/styles/style.css".

anybody tell me that this is the main reason or not

Owaiz Yusufi
  • 687
  • 1
  • 8
  • 25

2 Answers2

1

A Simple description to whats happening during the process is that browser Send HTTP Request and receive a response to that request from the server to two contains headers.in this case your server is making stylesheet come with wrong content-type try first to inspect element using dev tools in browser and investigate the response from server . i believe if you create new htaccess with the following content :

AddType text/css .css 

this will tell server to send it as stylesheet

Neinrappeur Zaki
  • 397
  • 2
  • 12
  • but I have changed the LoadModule rewrite_module modules/mod_rewrite.so into #LoadModule rewrite_module modules/mod_rewrite.so – Owaiz Yusufi Nov 26 '16 at 13:40
0

Many times when your css file is large so your browser stores it in cache and hence not every time it renders your css file when updated in editor and reloaded the site.

To rectify this simply press Ctrl+F5.

This will clear the browser cache for that tab(that website) and reload the page forcing the browser to render the updated css.

This should work without touching your .htaccess file.

EDIT: For Mac if you are using safari, the sortcut is Command+Alt+E

In Mac if you are using Chrome, Ctrl+F5 will not work, so refer to this site: https://clear-my-cache.com/en/apple-mac-os/google-chrome.html

  • It might be worth to mention Ctrl+F5 works on windows and provide an alternative to mac users. – Shimi Dec 02 '20 at 03:48