By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,253 Members | 1,676 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,253 IT Pros & Developers. It's quick & easy.

Style Sheet not always responding

JnrJnr
P: 88
I have a StyleSheet.css in my project with no errors (checked by jigsaw.w3.org/css-validator/).
When I change a value in my style sheet the page doesnt respond to the change but when I remove the contents from the style sheet and place it with my html code in the <style type = "text/css"> then the change responds.
I refer to my style sheet correctly <link rel = "Stylesheet" type = "text/css" href = "StyleSheet.css"/>
When I delete the styleSheet.css file and add a new one and rename it it works fine for a while until I carry on working and find that it's not working anymore.
Any Ideas what I should look at? Im pretty sure my HTML is correct.
Apr 11 '11 #1

✓ answered by JKing

Do you have your cache on or off?

You can try adding a query string to your stylsheet path. Just continually change the value.

Some like to use the date or time as it is constantly changing.

Expand|Select|Wrap|Line Numbers
  1. <style type="text/css" rel="stylesheet" href="stylesheet.css?v=1"
  2.  

Share this Question
Share on Google+
3 Replies


JKing
Expert 100+
P: 1,206
Do you have your cache on or off?

You can try adding a query string to your stylsheet path. Just continually change the value.

Some like to use the date or time as it is constantly changing.

Expand|Select|Wrap|Line Numbers
  1. <style type="text/css" rel="stylesheet" href="stylesheet.css?v=1"
  2.  
Apr 11 '11 #2

JnrJnr
P: 88
ok so whats happening is as soon as you make changes to your style sheet it caches the file and you have to update the name of the syle sheet in order for it to take effect. Thanx!
Apr 11 '11 #3

Dormilich
Expert Mod 5K+
P: 8,639
you could also set the cache header to must-revalidate in your server.
Apr 13 '11 #4

Post your reply

Sign in to post your reply or Sign up for a free account.