CSS: What does the question mark at the end of css do?

Wikipedia css example:

#content a[href^="https://"], .link-https {
  background:url("images/external-link-ltr-icon.png?2") no-repeat scroll right center transparent;
  padding:0 13px 0 0;
}
+3
source share
7 answers

This is actually not part of the CSS itself, but rather part of the image request.

This is the same as:

http://foo/images/external.png?bar=baz

The site will accept this parameter and the querystring value as part of the request. He could decide which file should be served based on the value provided.

This is probably the version number. This helps circumvent situations where your browser can cache the image.

+8
source

This (usually) is used to invalidate the cached version of the image.

When you create a new version of the image, you change the number, which causes browsers to reload and not use the cached version.

CSS, .

+2

, , -. , , , , .

+1

, URL-. , HTTP-url; , , , script, , .

. , , . , , . , .

+1

CSS, .

0

, URL. cache-busting. , , .

0

CSS, URL-; .

0
source

Source: https://habr.com/ru/post/1773419/


All Articles