什么是“styles.css?= 121”是什么意思在这个html代码? [英] What does "styles.css?=121" mean in this html code?

查看:207
本文介绍了什么是“styles.css?= 121”是什么意思在这个html代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我看一些html代码放置样式表以这种方式:

I look in some html codes placed the stylesheet in this way:

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

这是什么意思?

推荐答案

我们可以使用如下的查询选择器来清除CSS样式表缓存:

We can clear the CSS style sheet cache by using the query selector like this:

<link rel="stylesheet" href="style.css?v=1.1"> 

当您更改css更改版本如下:?v = 1.2然后您的浏览器将加载新更新css。请注意,每次更改css时,您都可以替换为任何数字。

When you change the css change the version like this: ?v=1.2 after then your browser will load newly updated css. Note that you can replace to any number each time you change the css.

这对CSS没有影响。它只会使浏览器认为它是一个完全不同的文件。

This will have no effect on the CSS. It will only serve to make the browser think it’s a completely different file.

如果你不改变一段时间的值,浏览器将继续缓存保存)文件,并且不会尝试下载它,除非其他因素强制它,或者你最终更新查询字符串值。

If you don’t change the value for a while, the browser will continue to cache (or preserve) the file, and won’t attempt to download it unless other factors force it to, or you end up updating the query string value.

您可能也感兴趣在

这篇关于什么是“styles.css?= 121”是什么意思在这个html代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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