0

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

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

what does it mean?

0

2 Answers 2

7

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

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

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.

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.

You may also be interested in this

Sign up to request clarification or add additional context in comments.

2 Comments

I am wundering how the style file would then look like style.css?v=1.1or style.css?
It would take style.css but just querying allows you to use newer file, and if you inspect you'll see like style.css?v=1.1
0

The ?=121 is a query string parameter. As it is used in your example it might be to avoid caching.

If it looked something like ?v=1 then it might be used for selecting different versions of that stylesheet.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.