由于搜索功能,样式变得混乱

时间:2013-07-05 08:05:25

标签: php html css

由于我搜索了一段时间的页面中的某些内容而导致页面混乱,我无法找到错误。

可能是zoek.html中的div,但你们可以看看吗?

正是发生了什么:正常页面菜单中间的浮动当打开这一个菜单进入左侧角落时,内容菜单也会向左移动。

home_zoek.php * PHP:

<?php
include("config/instellingen.php");
ob_start();
session_start();
$loggedin = $_SESSION['loggedin']; 

if (empty($_SESSION['naam'])){
    die("Log eerst in voordat u deze pagina bezoekt.");
}
if (isset($_GET['logout'])){
    session_destroy();
    header("Refresh: 0; url=\"index.php\"");
}
date_default_timezone_set("Europe/Amsterdam");
$logdate = date('H:i:s');                
$logs = "INSERT INTO `logs` (`id` ,`naam` ,`text`,`datum`,`ip`)VALUES (NULL , '$_SESSION[naam]', 'Heeft pagina $_SERVER[PHP_SELF] bekeken', '$logdate','$_SERVER[REMOTE_ADDR]');";
$meldingen2 = mysqli_query($connect, $logs);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>Heijmans | Planning</title>
    <link href='http://fonts.googleapis.com/css?family=Droid+Serif:400italic' rel='stylesheet' type='text/css'>
    <link rel="stylesheet" type="text/css" href="css/_style_logged.css" />
    <link rel="stylesheet" type="text/css" href="css/_style_menu_left.css" />
    <link rel="stylesheet" type="text/css" href="../css/_style_menu_left.css" />
    <link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet'>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script src="../js/script.js"></script>  
    <!--[if IE]>
        <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
</head>
<?php include("home_menu.php"); ?>
    <div id="header-with-tabs">
        <?php include("home_menu-3.php"); ?>
    </div> 

    <div id="content">
        <?php include("home_menu-2.php"); ?>
        <div class="page-full-width cf">
             <div class="side-content fr">
                  <div class="content-module">
                       <div class="content-module-heading cf">
                            <h3 class="fl">Hoofd pagina</h3>
                            <span class="fr expand-collapse-text">Klik om te verkleinen</span>
                            <span class="fr expand-collapse-text initial-expand">Klik om te vergroten</span>
                        </div>
                        <div class="content-module-main">
                            <thead>
                                <p>
                                    <font color="black">Zoek hier op postcode of klantvraagnummer de resultaten verschijnen automatisch en zijn altijd up to date</font>
                                </p>
                                <p>
                                    <font color="black">Minimum 3 letters, bijv. 1093 VD.</font>
                                </p>
                                <?php include("zoek.html"); ?><br />
                                <div id="show_results"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </thead>
        </ul>
    </table>
</div>
</div>
</div>  
<?php include("home_footer.php"); ?>
</body>
</html>

zoek.html * PHP:

<head>
    <script type="text/javascript" src="js/search.js"></script>
    <script src="js/pagination.js" type="text/javascript"></script>
    <script>
    htmlData('search.php', '');
    </script>
</head>
<body>
    <div id="form">
        <input type="text" id="terms" onkeyup="getScriptPage('show_results','terms','1')" onblur="if ( this.value == '' ) this.value = this.defaultValue" onfocus="if ( this.value == this.defaultValue ) this.value = ''"/>
    </div>
    </div>
</html>

1 个答案:

答案 0 :(得分:1)

识别您的代码以查看您的html代码中是否有额外的标签或错误放置的标签非常重要。在这种情况下,</thead>中的<div class="content-module-main">位于错误的位置。此外,您还有额外的</div>代码。

此处的另一个问题是,<head>文件中包含<body></html>zoek.html个标记。由于代码直接插入父文件home_zoek.php,因此不会在此处使用它们。

删除它们,清理代码,它应该按预期运行。