Webpage stopped responding to external CSS changes

空扰寡人 提交于 2020-03-06 05:57:14

问题


I'm currently working on developing a website on my computer, and I've been very successful at working on my html and external stylesheet for some time. The results don't come out the way I want, but at least the code is doing what I tell it to do.

However, I've been trying to incorportate PHP into my pages and I've since downloaded MAMP to my computer and changed my pages into .php pages so that the php pages I want to include are included. I managed to do all that just fine and yesterday I went back to work on my layout some more.

Suddenly, none of my webpages, either the .php version or the original .html version, are interacting or responding to changes I make in my .css file. It all worked fine before, but now suddenly it wont respond. I've tried turning my MAMP server off, I've tried removing the .css file and then restoring it (thinking somehow it was getting stuck on old code?) and I've tried tweaking the code in the original folder I was working out of. Not that it should matter, and it didn't.

Am I missing something?

When I downloaded MAMP, I had to copy and more my original files to the "htdocs" folder so that my local host could have access to the files. I would understand if there was something wrong there, but it isn't responding in the original files either.

In addition to changes not being acknowledged (or perhaps because of), my navigation bar is responding to code that doesn't exist.

Is there a way to fix this that does not involve starting over?


回答1:


This sounds like a caching issue.

There are tags you can use that will help. Also make sure your browser cache settings aren't on Automatic, but Every visit to the page.

I have to use all these to try to cover all the bases:

<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />


来源:https://stackoverflow.com/questions/28863309/webpage-stopped-responding-to-external-css-changes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!