我在网站上有一个下拉式javascript菜单,它被一些php包含在每个页面中。在Firefox中没有问题,但是在Chrome浏览器中查看时,菜单在大多数页面上都表现得很奇怪,但不是全部,我无法弄清楚在几个正确的页面上是否正确。
主页看起来很好:http://solve-et-coagula.us/
与此页面一样,大多数(在Chrome中)在菜单上方添加了一个空格:http://solve-et-coagula.us/design.php
此页面显示正确:/rabbithole/k_2.php
这个不是:/hermeticism/gunas.php
此外,在Chrome的所有情况下,下拉菜单都显示在菜单图片的顶部而不是底部。
我已经使用了一段时间的菜单了,几年前在某个地方抓住了这种格式,并在美学上进行了调整。
页面的开头就像(k_2.php):
<?php
session_name("MyLogin");
session_start();
include($_SERVER['DOCUMENT_ROOT']."/menu.html");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
<title>Registration</title>
<meta content="text/html" http-equiv="Content-Type" />
<link rel="stylesheet" type="text/css" href="rabbithole.css" />
<link rel="stylesheet" type="text/css" href="/general.css" />
<script src="/javascript.js" type="text/javascript"></script>
<script src="rabbithole.js" type="text/javascript"></script>
</head>
<body>
<table border="0" cellspacing="20" width="100%">
<tr>
<td class="title"><h1>Create an Account</h1></td>
</tr>
[...]
<?php
session_name("MyLogin");
session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<head>
<title>Graphic & Web Design</title>
<meta content="text/html" http-equiv="Content-Type" />
<link rel="stylesheet" type="text/css" href="rabbithole/rabbithole.css" />
<link rel="stylesheet" type="text/css" href="general.css" />
<script src="javascript.js" type="text/javascript"></script>
</head>
<body>
<?php
include($_SERVER['DOCUMENT_ROOT']."/menu.html");
?>
<table border="0" cellspacing="20" width="100%">
<tr>
<td class="title"><h1>Graphic & Web Design</h1></td>
</tr>
<tr>
<td>
<p>
[...]
<div align="center" id="page">
<div id="header">
<div id="mainmenu">
<span onmouseover="dropdownmenu(this, event, menu1, '146px')" onclick="return clickreturnvalue()" onmouseout="delayhidemenu()"><img alt="Hermetic Qabalah" class="menuimages" src="/images/libri.png" /></span>
<span onmouseover="dropdownmenu(this, event, menu2, '146px')" onclick="return clickreturnvalue()" onmouseout="delayhidemenu()"><img alt="Eastern Mysticism" class="menuimages" src="/images/theology.png" /></span>
<span onmouseover="dropdownmenu(this, event, menu3, '146px')" onclick="return clickreturnvalue()" onmouseout="delayhidemenu()"><img alt="Ceremonial Magick" class="menuimages" src="/images/rituals.png" /></span>
<span onmouseover="dropdownmenu(this, event, menu4, '146px')" onclick="return clickreturnvalue()" onmouseout="delayhidemenu()"><img alt="Solve et Coagula" class="menuimages" src="/images/solveetcoagula.png" /></span>
<span onmouseover="dropdownmenu(this, event, menu5, '146px')" onclick="return clickreturnvalue()" onmouseout="delayhidemenu()"><img alt="Liber Legis" class="menuimages" src="/images/thelema.png" /></span>
<span onmouseover="dropdownmenu(this, event, menu6, '146px')" onclick="return clickreturnvalue()" onmouseout="delayhidemenu()"><img alt="Lemegeton" class="menuimages" src="/images/lemegeton.png" /></span>
<span onmouseover="dropdownmenu(this, event, menu7, '146px')" onclick="return clickreturnvalue()" onmouseout="delayhidemenu()"><img alt="Miscellanea" class="menuimages" src="/images/hermeticism.png" /></span>
</div>
</div>
</div>
帮助将不胜感激;这还没有解决。
答案 0 :(得分:1)
在http://solve-et-coagula.us/design.php上方顶部有额外的" "
(其他页面上没有),当它被删除后,菜单会正确显示。
查看该页面的代码,看看PHP是否有额外的echoed
。
此外,您应该在head
元素中包含元链接和标题标记。