My webpage ignores changes in CSS file

后端 未结 5 1932
天命终不由人
天命终不由人 2021-01-23 06:11

No matter what I change in my .css file, the page remains the same - what\'s more, neither changing the link tag so that it points to another .css file nor deleting it completel

相关标签:
5条回答
  • 2021-01-23 06:22

    There may be many tips but the important tip are:

    1. Check the file you are updating (CSS file).

    2. Upon updating in the file go to the localhost.

    3. Press CTRL+F5 for updating the cached file and the work is done.

    0 讨论(0)
  • 2021-01-23 06:23

    You css is getting cached. If you clear your cache, you will see a difference.

    There are techniques you can apply to bust the cache, such as appending a timestamp or build number to your filename or link. If this is for development purposes and your production copy won't change much, I wouldn't bother, as clearing your browser's cache will suffice.

    0 讨论(0)
  • 2021-01-23 06:26

    On your browser, try the keyboard combination CTRL-F5 to clear whatever cache you have on the site...

    0 讨论(0)
  • 2021-01-23 06:43

    First check that you making the changes in the right file(believe it happens all the time).

    Second if you are playing with the right file check that your changes can be applied. for example use !important to force the browser to use that CSS style.

    Third when you are dealing with JS or CSS Always be sure that you are not working with a cached copy (again it happens all the time)

    kindly check this to force your browser to ignore the cache

    Browser for Developers no cache

    0 讨论(0)
  • 2021-01-23 06:45

    Solved, and it wasn't about caching! I thought .css files are to blame, but the mistake was between chair and keybord.

    The body of my html/php code looked like this:

    <body>
    
    <?php
      include 'header.php';
      include 'left_menu.php';
      include 'footer.php';
    ?>
    
    *main page code*
    
    </body>
    

    My footer and main page were all moved inside the left menu (I don't know what exactly caused this problem, but I know how to solve it now). I mistakenly blamed some error in .css file of this, so I asked this question. If I had e.g. changed the background color or made some other change clearly visible on the tiny space left for my main page, it would become clear that the .css file updates normally and problem is somewhere else.

    I just changed the position of include tags and everything is OK:

    <body>
    
    *main page code*
    
    <?php
      include 'header.php';
      include 'footer.php';
      include 'left_menu.php';
    ?>
    
    </body>
    

    Sorry for asking you for something else than I really wanted, and thanks for teaching me how to solve caching problems (I'm almost sure I'll face them some day in the future).

    0 讨论(0)
提交回复
热议问题