duanjiaonie6097 2016-09-23 18:25
浏览 57
已采纳

包括header.php css,不会工作包括footer.php或正文

I am attempting to require '_header.php'; and require '_footer.php'; so I can create a dynamic body for my site.

However none of the CSS will work in the body or in the footer. CSS will only work for the header.

Why is this happening and how could it be solved?

require '_header.php';



$form_to_echo = '<div class="form_wrap"><form id="registration" action="new_user.php" method="post">                                                                

    <div class="i_group"><span class="s_name">Класа:</span> 
    <input type="radio" id="_rad_rnk_class_h" name="rank_class" value="H"'.$_frm_selected_rank_class_h.'><label for="_rad_rnk_class_h">Хоби</label>
    <input type="radio" id="_rad_rnk_class_t" name="rank_class" value="T"'.$_frm_selected_rank_class_t.'><label for="_rad_rnk_class_t">Трофеј</label>
    </div>

    <input type="text" id="cell_phone" name="cell_number" placeholder="Мобилен телефон" value="'.$_POST['cell_number'].'">
    </div>  

    <div class="i_group"><span class="s_name">Крвна група:</span><br><br>                               
    <input type="radio" id="_rad_bld_typ_a" name="blood_type" value="A"'.$_frm_selected_bld_typ_a.'><label for="_rad_bld_typ_a">A</label>
    <input type="radio" id="_rad_bld_typ_b" name="blood_type" value="B"'.$_frm_selected_bld_typ_b.'><label for="_rad_bld_typ_b">B</label>
    <input type="radio" id="_rad_bld_typ_ab" name="blood_type" value="AB"'.$_frm_selected_bld_typ_ab.'><label for="_rad_bld_typ_ab">AB</label>
    <input type="radio" id="_rad_bld_typ_o" name="blood_type" value="O"'.$_frm_selected_bld_typ_o.'><label for="_rad_bld_typ_o">O</label>
    </div>                                      
    <div class="i_group">               
    <input type="submit" name="submit" class="submit" value="Pегистрирај">
    </div></form></div>';


if ($error_count_up != 0) { 

    echo $form_to_echo; 

}

require '_footer.php';  

When I copy and paste the code in HTML it works just fine...


<!DOCTYPE html>
<html>


    <head lang="mk">
        <meta charset="utf-8">


        <link rel="stylesheet" type="text/css" href="style.css">


        <link rel="stylesheet" type="text/css" href="./css/font-awesome.min.css">

        <title>;</title>
        <style type="text/css">

</style>



               <script src="//ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script> 
               <!--<script src="script.js"></script> -->


                 <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
                  <script src="//code.jquery.com/jquery-1.12.4.js"></script>
                  <script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
                  <script>
                        $( function() {
                            $( "#datepicker" ).datepicker({
                                changeMonth: true,
                                changeYear: true
                            });
                        $( "#datepicker" ).datepicker( "option", "dateFormat", "dd-mm-yy" );
                        } );
                  </script>

    </head>





    <body>      



        <div id="showcase">


            <div id="sw_img1"></div>
            <div class="img_fade"></div>

                <div class="main_wrapper">

                    <div id="logo"></div>


                    <ul id="top_nav">

                        <li>Правилник</li>

                        <li>Контакт</li>    

                    </ul>


                </div>

        </div>

        <div class="test1">test</div>






    </body>





</html>
  • 写回答

2条回答 默认 最新

  • douxing5598 2016-09-23 18:31
    关注

    Try using include... PHP: include

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序