Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/241.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包含以下内容时,下拉菜单可用于HTML问题_Php_Html_Css - Fatal编程技术网

当PHP包含以下内容时,下拉菜单可用于HTML问题

当PHP包含以下内容时,下拉菜单可用于HTML问题,php,html,css,Php,Html,Css,问题是,当单击下拉菜单时,没有菜单下来。在使用PHP的include之前,菜单按其应有的方式工作 最初,每个.html页面都包含自己的导航条形码。然而,我最近发现了PHP的include函数。我将导航栏的部分代码复制到navigation.php,并在index.php的原始.html页面中使用了php include语句。我已经删除了许多不必要的代码: <?php include("includes/navigation.php"); ?> 这是index.php文件中唯一的一行

问题是,当单击下拉菜单时,没有菜单下来。在使用PHP的include之前,菜单按其应有的方式工作

最初,每个.html页面都包含自己的导航条形码。然而,我最近发现了PHP的include函数。我将导航栏的部分代码复制到navigation.php,并在index.php的原始.html页面中使用了php include语句。我已经删除了许多不必要的代码:

<?php include("includes/navigation.php"); ?>
这是index.php文件中唯一的一行代码

<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Invest for Hope - Donations</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="icon" href="/assets/favicon.ico">
<link rel="apple-touch-icon" href="/assets/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="72x72" href="/assets/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="114x114" href="/assets/apple-touch-icon-114x114.png">
<link rel="shortcut icon" href="favicon.ico"> 
<link href="http://netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" rel="stylesheet">

<link href='http://fonts.googleapis.com/css?family=Open+Sans:300' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Lato:400,700' rel='stylesheet' type='text/css'>
<style type="text/css">html,body{height:100%;}.container-full{margin:0 auto;width:100%;min-height:100%;background-color:#110022;color:#eee;overflow:hidden;}.container-full a{color:#efefef;text-decoration:none;}.v-center{margin-top:7%;}[class^="cus-"],[class*=" cus-"]{display:inline-block;width:17px;height:16px;*margin-right:.3em;line-height:14px;vertical-align:text-top;background-image:url("/assets/social-icons-nav.png");background-position:14px 14px;background-repeat:no-repeat;opacity:0.5;}[class^="cus-"]:last-child,[class*=" cus-"]:last-child{*margin-left:0;}[class^="cus-"]:hover,[class*=" cus-"]:hover{opacity:1;}.cus-social-email{background-position:0 0;width:24px;height:24px;}.cus-social-facebook{background-position:-29px 0;width:24px;height:24px;}.cus-social-twitter{background-position:-58px 0;width:24px;height:24px;}.cus-social-youtube{background-position:-87px 0;width:24px;height:24px;}.btn-xlmain{width:310px;height:18px%;position:absolute;text-align:center;left:0;right:0;margin-left:auto;margin-right:auto;z-index:51;margin-top:-50px;}</style>
</head>
<body>
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
      <!-- Collect the nav links, forms, and other content for toggling -->
      <div class="collapse navbar-collapse">
        <ul class="nav navbar-nav">
        <li class="dropdown">
            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><i class="glyphicon glyphicon-user"></i> About<b class="caret"></b></a>
            <ul class="dropdown-menu">
                <li>
                    <a href="mission.html"> About</a>
                </li>
                <li>
                    <a href="team.html"> Team</a>
                </li>
            </ul>
        </li>
        <li>
        </ul>
    </div>
</nav>
这是从navigation.php文件中删除大部分内容后的所有代码。现在,它只包括下拉菜单和CSS来格式化页面


如果要使用下拉菜单查看实际问题,请转到。主页显示了我所显示的代码。

您需要在页面中添加JQuery和引导javascript

下载它们或使用CDN进行快速测试,在HTML内部添加以下行:


看看你提供的链接的来源。通过省略用于删除.modal对话框的结束注释标记,您已经注释掉了所有JS包含。 通过添加close comment marker->after.modal对话框的closing标记来撤销该错误,它将正常工作

这就是你所拥有的

<!--
    <div class="modal-dialog">
    ...
    <script ... >
    ...
    </body>
</html>
虽然浏览器可能会呈现关闭注释标记,但没有关闭注释标记

这是您应该拥有的,匹配的结束标记在哪里

<!--
    <div class="modal-dialog">
    ...
    </div> 
-->
<script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
etc etc
还有这一行根本没用

<script>"js/bootstrap.js"</script>

那么,includes/navigation.phpIt的includes在index.php中的位置是什么呢?你似乎对HTML注释有一些问题,为什么在使用BootStarpName时使用自己的css呢?一些严重但非常基本的错误是由一些不应该在他们的实时网站上发布的人造成的。@JoshTheLiuser你已经大量破坏了该网站。把它交给那些知道他们在做什么的人。看看来源。奥普认为他们have@Popnoodles我已经在他的网页上测试了添加这两个JS,效果很好。我相信这就是原因,事实上这是一个很好的观点,他只包含了CSS,没有为bootstrapNo添加任何其他内容,这并没有解决它。它把一个创可贴解决了一个简单的问题。你只是在破坏网站。让别人帮你修好它,因为虽然外行觉得它很管用,但现在它已经坏得很厉害了。@poplane,非常感谢你。我错了。你是对的。我将注释部分添加到footer.php中,这是我在index.php中包含的另一部分。现在一切都很好。非常感谢你的帮助!实际上,我在navigation.php中包含了所有注释掉的代码。谢谢你的帮助!谢谢你!