duanjiaonie6097 2016-09-23 10: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 10:31
    关注

    Try using include... PHP: include

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

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部