CSS文件未在浏览器中刷新 [英] CSS file not refreshing in browser

查看:80
本文介绍了CSS文件未在浏览器中刷新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我对CSS文件进行任何更改时,这些更改不会反映在浏览器中.我该如何解决?

When I make any changes to my CSS file, the changes are not reflected in the browser. How can I fix this?

推荐答案

?尝试打开样式表本身(通过在浏览器的地址栏中输入其地址),然后按 F5 .如果仍然无法刷新,则问题出在其他地方.

For weeks? Try opening the style sheet itself (by entering its address into the browser's address bar) and pressing F5. If it still doesn't refresh, your problem lies elsewhere.

如果更新样式表并要确保在每个访问者的缓存中刷新样式表,一种非常流行的方法是将版本号添加为GET参数.这样,样式表会在必要时进行刷新,但刷新的频率不会超过此次数.

If you update a style sheet and want to make sure it gets refreshed in every visitor's cache, a very popular method to do that is to add a version number as a GET parameter. That way, the style sheet gets refreshed when necessary, but not more often than that.

<link rel="stylesheet" type="text/css" href="styles.css?version=51">

这篇关于CSS文件未在浏览器中刷新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆