Home  >  Article  >  Web Front-end  >  What should I do if the css is not updated after modification?

What should I do if the css is not updated after modification?

藏色散人
藏色散人Original
2021-02-03 10:04:005003browse

Solution to the problem that css does not update after modification: 1. Clear the browser cache before debugging; 2. Check "Disable cache" on the debugging page; 3. Use "ctrl shift R" to force refresh; 4. Modify css and js code.

What should I do if the css is not updated after modification?

The operating environment of this article: windows7 system, HTML5&&CSS3 version, Dell G3 computer.

In the process of web development, we often need to debug js code, and at this time our modified code may not take effect. This is because the browser has a cache by default, but at this time the cache will affect our debugging work. Here we will introduce how the Chrome browser solves this problem.

Chrome css modification does not update solution:

Method 1: Clear the browser cache before debugging

In the browser settings interface

Or use the shortcut key to directly clear the cache ctrl shift delete

2. Set the browser not to cache the page

Check Disable cache on the debugging page

3. Force Refresh the page

Use ctrl shift R to force refresh and refresh the page without using the browser cache

4. Solve the caching problem from the code perspective

The browser will cache css or js file, by setting and changing the version number, the browser will re-download the new js or css file. Add ?v= after js or css. The usage of the version number is as follows

css and js with parameters (in the form .css?v= and .js?v= or .css?version= and .js?version= )

<script type=”text/javascript” src=”jsex.js?version=1.1.6″></script>
<link rel=’stylesheet’ href=’cssex.css?version=1.3.1′ type=’text/css’ />

Recommendation: "css video tutorial"

The above is the detailed content of What should I do if the css is not updated after modification?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What is WebUINext article:What is WebUI