简体   繁体   English

CSS更改不会立即显示在浏览器中 - Codeigniter

[英]CSS changes will not show up instantly in browser - Codeigniter

I have a problem about CSS in my codeigniter project. 我的codeigniter项目中有一个关于CSS的问题。

I have separate views for header, footer and for rest of the pages. 我有页眉,页脚和其他页面的单独视图。 I have loaded my CSS files inside the header view. 我已将CSS文件加载到标题视图中。 every thing is working great. 每件事都很有效。 Only problem is that when I make a change inside my CSS file it wont show up even after refreshing the page. 唯一的问题是,当我在CSS文件中进行更改时,即使刷新页面后也不会显示。 It will only show up if I restart the whole PC. 它只会在重新启动整个PC时出现。 I know this is not a very big problem, but it is making it harder to debug the project. 我知道这不是一个很大的问题,但它使调试项目变得更加困难。 I just want you guys to tell me what is it that i am missing or doing wrong. 我只想让你们告诉我,我错过了什么或做错了什么。

Thank you in advance. 先感谢您。

PS i am student, new to codeigniter and also new to STACK OVERFLOW, so please think twice before down voting my question PS我是学生,是codeigniter的新手,也是STACK OVERFLOW的新手,所以请在投票前再三思考我的问题

This is my HEADER.

<html>
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="Colorlib Templates">
  <meta name="author" content="Colorlib">
  <meta name="keywords" content="Colorlib Templates">
  <title>User Authorization </title>
  <link href="<?php echo base_url();?>assets/vendor/mdi-font/css/material-design-iconic-font.min.css" rel="stylesheet" media="all">
    <link href="<?php echo base_url();?>assets/vendor/font-awesome-4.7/css/font-awesome.min.css" rel="stylesheet" media="all">
    <!-- Font special for pages-->
    <link href="https://fonts.googleapis.com/css?family=Poppins:100,100i,200,200i,300,300i,400,400i,500,500i,600,600i,700,700i,800,800i,900,900i" rel="stylesheet">

    <!-- Vendor CSS-->
    <link href="<?php echo base_url();?>assets/vendor/select2/select2.min.css" rel="stylesheet" media="all">
    <link href="<?php echo base_url();?>assets/vendor/datepicker/daterangepicker.css" rel="stylesheet" media="all">

    <!-- Main CSS-->
    <link href="<?php echo base_url();?>assets/css/main.css" rel="stylesheet" media="all">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>

Should be a caching-problem. 应该是一个缓存问题。 Please try to clear your cache, or disable caching. 请尝试清除缓存,或禁用缓存。

In Firefox and Chrome you should be able to reload the page with cleared cache by pressing ctrl + F5 . 在Firefox和Chrome中,您应该可以通过按ctrl + F5重新加载已清除缓存的页面。 (This could work in other browsers, too. But havn't tested) (这也适用于其他浏览器。但是没有经过测试)

To get rid of the caching-problem you could try to set the following meta-tags in your head: 要摆脱缓存问题,您可以尝试在脑中设置以下元标记:

<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Expires" content="0" /> 

to learn more take a look at this answer 要了解更多,请看一下这个答案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM