3

I'm having a very odd problem with CSS either not updating after changes or simply not going away after deleting it.

<form action="Test.php" method="post" class="Box1">

 <h1> Please Enter Main link Information</h1>
    Link <input  value= "<a href ='Enter Website here'>Enter Headline here</a>"       type="text" size="50" name="linkurl"><br>
    Story #:<input type="text" " name="storyn"> 
    <input type="submit">
 </form>

My CSS looks like this:

  .Box1{
    position: absolute;
    left: 400px;
    top: 100px;
    height: 300px;
   }

Now the first time I typed this in, it worked perfectly. Then I went to change the values within the CSS, and it wouldn't change, tried again, wouldn't change. Finally I removed .Box1 completely from the CSS page, just to see what would happen, and it still didn't change anything. Is there anything on the server side that could be causing CSS not to update? I've never had an issue like this before.

Jcmoney1010
  • 912
  • 7
  • 18
  • 41
  • 4
    Did u try clearing browser cache ? – MikeWu Jul 26 '14 at 00:49
  • 2
    This is a cache issue. The css is cached client side and often also server side. – skarist Jul 26 '14 at 00:49
  • This could be a caching issue. I have that problem constantly with Safari on the Mac. I do refresh and it still gets the old CSS. Reset Safari fixes it. I suspect other browsers do the same and so might servers. – Peter Wooster Jul 26 '14 at 00:50
  • 3
    Anytime this sorta thing happens just pop open a Chrome incognito or Firefox private window with the URL and see how it goes. This should not have been down-voted without a reason though. Damn kids. – Deryck Jul 26 '14 at 00:51
  • I have no idea why this was down voted. – Peter Wooster Jul 26 '14 at 00:53
  • @deryck, great idea, you should put that in an answer. – Peter Wooster Jul 26 '14 at 00:54
  • @PeterWooster Thanks I agree but now that emzy has increased my knowledge of keyboard shortcuts (and after I [researched](http://stackoverflow.com/questions/385367/what-requests-do-browsers-f5-and-ctrl-f5-refreshes-generate) [around](https://support.mozilla.org/en-US/kb/keyboard-shortcuts-perform-firefox-tasks-quickly?redirectlocale=en-US&redirectslug=Keyboard+shortcuts) [the web](https://support.google.com/chrome/answer/157179?hl=en&ref_topic=25799) ), I like his answer very much. – Deryck Jul 26 '14 at 01:33
  • @PeterWooster Already tried clearing the cache, and it's still acting weird and only working sporadically. Clearing the cache fixed the issue with it still being styled after deleting `.Box1`, but now it's not styling anything at all. This is really becoming a head scratcher. – Jcmoney1010 Jul 26 '14 at 01:37
  • 1
    An easy check to fix would be to rename the CSS file (as well as the name in the HTML that links to it of course) and then refresh. That will force any possible server caching to reload it as well, if they are active. If this and the force no-cache reload CTRL + F5 fail to produce your result, you need to inspect the CSS and see what properties are being inherited and from where. – Deryck Jul 26 '14 at 01:43
  • @Deryck Renaming the CSS file fixed it immediately after I saved it. The form did exactly what it was supposed to, but again when I tried to make an adjustment to the `top` value in the CSS code, it does nothing. Is there a way to stop these cache issues? – Jcmoney1010 Jul 26 '14 at 01:47
  • Yeah but it'll take some conversation so let's do it in a chat – Deryck Jul 26 '14 at 01:52
  • http://chat.stackoverflow.com/rooms/58039/servertalk21 – Deryck Jul 26 '14 at 01:53

2 Answers2

4

Try a force-refresh to dump your browser cache.

Ctrl+F5 or Ctrl+Shift+R

You might try opening the stylesheet URL directly and force-refresh that.

sina72
  • 4,931
  • 3
  • 35
  • 36
mz3
  • 1,314
  • 11
  • 27
  • 1
    Especially if you are in Chrome, it has a nasty habit of caching and hanging on to designs. When doing UI always have the developer tools in that browser open and have the option to always request files checked or disable the local cache. This will save a ton of headaches in the future. – TheHamstring Jul 26 '14 at 02:29
0

An easy check to fix would be to rename the CSS file (as well as the name in the HTML that links to it of course) and then refresh. That will force any possible server caching to reload it as well, if they are active.

If this and the force no-cache reload CTRL + F5 fail to produce your result, you need to inspect the CSS and see what properties are being inherited and from where.

Deryck
  • 7,608
  • 2
  • 24
  • 43
  • Sorry I missed the chat invite you sent me, I walked away from the computer for a bit. I've never had CSS issues like this before and it's getting really frustrating. – Jcmoney1010 Jul 26 '14 at 02:27
  • @Jcmoney1010 I'll stay in the room for a bit if you end up coming back so we can figure out what your server is doing – Deryck Jul 26 '14 at 02:29