Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在PHP中刷新我的注册表(注册)表单后,CSS不会加载_Php_Css - Fatal编程技术网

在PHP中刷新我的注册表(注册)表单后,CSS不会加载

在PHP中刷新我的注册表(注册)表单后,CSS不会加载,php,css,Php,Css,我正在学习PHP,我在网上找到了有用的教程,所以我正试图用PHP构建我的第一个网站。我对CSS实现有问题。我总是打开localhost的选项卡,这样我就不必每次更改内容时都运行它。问题是,当我编写一些CSS时,它会加载到我的注册表上,但当我刷新页面时,就好像我从来没有为那个页面编写过CSS一样。(对不起,英语不好,我希望你们能理解我想说的话。) 下面是signup.php代码: <div class="container"> <div class="row"

我正在学习PHP,我在网上找到了有用的教程,所以我正试图用PHP构建我的第一个网站。我对CSS实现有问题。我总是打开localhost的选项卡,这样我就不必每次更改内容时都运行它。问题是,当我编写一些CSS时,它会加载到我的注册表上,但当我刷新页面时,就好像我从来没有为那个页面编写过CSS一样。(对不起,英语不好,我希望你们能理解我想说的话。)

下面是signup.php代码:

     <div class="container">
    <div class="row" style="text-align:center;">
        <h3>EPO - Sistem - Registracija </h3>
    </div>

    <div class="row sub_msg">
        <p> Veb aplikacija za evidenciju predispitnih obaveza. </p>
    </div>

    <div class="row signup">
        <div class="row">
            <h3> Dobrodosli, molimo Vas, unesite podatke za registraciju. </h3>
        </div>

        <form action="" method="post" class="form-horizontal">

            <div class="row form-group input_group">
                <label for="" class="col-sm-2" >E-mail:</label>

                <div class="col-sm-10">
                    <input type="text" name="email" class="form-control">
                </div>
            </div>

            <div class="row form-group input_group">
                <label for="" class="col-sm-2" >Firstname:</label>

                <div class="col-sm-10">
                    <input type="text" name="firstname" id="firstname" class="form-control">
                </div>
            </div>

            <div class="row form-group input_group">
                <label for="" class="col-sm-2" >Lastname:</label>

                <div class="col-sm-10">
                    <input type="text" name="lastname" id="lastname" class="form-control">
                </div>
            </div>

            <div class="row form-group input_group">
                <label for="" class="col-sm-2" >Password:</label>

                <div class="col-sm-10">
                    <input type="password" name="password" id="password" class="form-control">
                </div>
            </div>

            <div class="row form-group" style="margin:0px 10px 20px 10px">
                <div class="col-xs-12">
                    <input type="submit" name="submit" id="Registruj se" class="form-control">
                </div>
            </div>





        </form>

    </div>

</div>    

我把她卡住了两个多小时,我敢肯定这是一些初学者犯的愚蠢错误,但我找不到它。

在下面的代码中href属性占用了不必要的空间

<link rel="stylesheet" href=" ./css/custom.css">

应该是:

<link rel="stylesheet" href="./css/custom.css">

此外,有时您可能需要清除缓存以显示css中的更改

在这种情况下,按下刷新按钮可能会让人厌烦,而不是进行刷新,我在css url的末尾添加了一个随机值,使其看起来像一个新url,这样就不会发生缓存


通过添加版本号进行检查,如

<link rel="stylesheet" type="text/css" href="./css/custom.css?version=51">

更正从

如果仍然不起作用,那么。

尝试更改此行(假设您的css文件夹与您的index.php处于同一级别)


到此为止

<link rel="stylesheet" href="css/custom.css?t=<?php echo time(); ?>">

您已定义CSS内联文件或其外部文件?href=“./CSS/custom.CSS”-删除空格字符-应为-href=“./CSS/custom.CSS”您可以尝试阅读以下内容:感谢您的支持。如果解决方案解决了您的问题,请随意接受此答案。我应该将其插入何处?(对不起,我是初学者)非常感谢你!上面贾斯汀和达珊·詹的回答对我很有帮助。也非常感谢你!清除缓存,实际上,ctrl+F5对我很有效。非常感谢这个提示!
<link rel="stylesheet" href="./css/custom.css?<?php echo rand(1,300);?>">
<link rel="stylesheet" type="text/css" href="./css/custom.css?version=51">
<link rel="stylesheet" href=" ./css/custom.css">
<link rel="stylesheet" href="css/custom.css?t=<?php echo time(); ?>">