http://wnmu.publicbroadcasting.net/test.html
我想让菜单在这里工作。在Firefox和Chrome中完美运行,但在Internet Explorer中无法使用。我尝试了IE8和IE9,包括兼容性视图,根本没有出现任何下拉。
以下是标题中的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">
<?xml version="1.0"?>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<a href="http://wnmufm.org" target="_self"><img src="http://www.wnmufm.org/wp-content/uploads/2011/05/pr90-banner.jpg" border="0"></a><br>
<div id="nav">
<ul id="menu" class="menu">
<li><a href="http://wnmu.publicbroadcasting.net/index.html">Home</a></li>
<li><a href="http://www.publicbroadcasting.net/wnmu/news.newsmain">News</a>
<ul class="menu">
<li><a href="http://events.publicbroadcasting.net/wnmu/events.eventsmain">Events Calendar</a></li>
<li><a href="http://wnmufm.org/category/news/">Regional News</a></li>
<li><a href="http://www.publicbroadcasting.net/wnmu/news.newsmain?action=section&SECTION_ID=2">National News</a></li>
<li><a href="http://www.publicbroadcasting.net/wnmu/news.newsmain?action=section&SECTION_ID=3">World News</a></li>
<li><a href="http://www.publicbroadcasting.net/wnmu/arts.artsmain">Arts News</a></li>
<li><a href="http://www.publicbroadcasting.net/wnmu/news.newsmain?action=section&SECTION_ID=5">Business News</a></li>
<li><a href="http://wnmufm.org/schoolclosings/">School Closings</a></li>
</ul>
</li>
<li><a href="http://wnmufm.org/localprograms">Programming</a>
<ul class="menu">
<li><a href="http://wnmufm.org/localprograms">Local Programs</a></li>
<li><a href="http://www.publicbroadcasting.net/wnmu/guide.guidemain">Program Guide</a></li>
<li><a href="http://www.publicbroadcasting.net/wnmu/guide.guidemain?action=searchPlaylist&playlistID=0">Search Playlist</a></li>
<li><a href="http://wnmu.publicbroadcasting.net/media/Preview%20PDF/WNMU-FM_Preview_May11.pdf">Download May Preview</a></li>
</ul>
</li>
<li><a href="http://wnmufm.org/livestream">Listen to PR90</a>
<ul class="menu">
<li><a href="http://wnmufm.org/livestream">PR90 Live Stream</a></li>
<li><a href="http://wnmufm.org/sportsstream">NMU Sports Stream</a></li>
<li><a href="http://www.publicbroadcasting.net/wnmu/.jukebox?action=programs">PR90 Podcasts</a></li>
<li><a href="http://wnmufm.org/nprpodcasts">NPR Podcasts</a></li>
</ul>
</li>
<li><a href="http://wnmufm.org/support">Support Us</a>
<ul class="menu">
<li><a href="https://secure.publicbroadcasting.net/wnmu/default/form.pledgemain">Make A Pledge</a></li>
<li><a href="http://secure.publicbroadcasting.net/wnmu/default/viewpremiums.pledgemain?newSearch=true&premiumType=all&orderBy=amount">Thank You Gifts</a></li>
<li><a href="http://wnmufm.org/matchinggifts">Matching Gifts</a></li>
<li><a href="http://wnmufm.org/underwriter">Become An Underwriter</a></li>
<li><a href="http://wnmufm.org/support">Ways to Give</a></li>
</ul>
</li>
<li><a href="http://wnmufm.org/insidepr90">Inside PR90</a>
<ul class="menu">
<li><a href="http://wnmufm.org/evelyn">Manager's Message</a></li>
<li><a href="http://wnmufm.org/history">Station History</a></li>
<li><a href="http://wnmufm.org/staff">PR90 Staff</a></li>
<li><a href="http://wnmufm.org/employment">Job Openings</a></li>
<li><a href="http://wnmufm.org/contact">Contact Us</a></li>
</ul>
</li>
</ul>
</div>
</body></html>
这是菜单CSS:
#nav
{
width:974px;
min-height:33px;
background:#d5c6a6 url(http://wnmufm.org/wp-content/themes/cover-wp/images/menu.png);
text-align:bottom;
}
ul#menu, .menu ul
{
padding:0;
list-style-type:none;
font-family:Georgia, "URW Bookman L", serif;
font-size:14px;
padding-right:285px;
margin:0;
}
ul#menu li, .menu ul li
{
float:left;
padding:0 5px;
margin:7px 0;
border-right:#333333 1px dotted;
margin-left:0;
}
ul#menu li a:link, ul#menu li a:visited, .menu ul li a:link, .menu ul li a:visited
{
display:block;
text-align:center;
padding:0 15px;
text-decoration:none;
color:#333333;
}
ul#menu li a:hover, ul#menu li a:active, .menu ul li a:hover, .menu ul li a:active, ul#menu li.current_page_item a, .menu ul li.current_page_item a:link, .menu ul li.current_page_item a:visited, .menu ul li.current_page_item a:hover, .menu ul .current_page_item a:active
{
background-color:#ffffff;
text-decoration:none;
color:#cc3300;
}
ul#menu li li
{
border-right:none;
margin:0;
margin-top:0px;
min-width:120px;
padding:0;
float:none;
}
ul#menu li li li
{
padding-left:1px;
}
ul#menu li li a, ul#menu li li a:link, ul#menu li li a:visited
{
background:#d5c6a6 url(http://wnmufm.org/wp-content/themes/cover-wp/images/submenu.png) bottom;
min-width:120px;
color:#333333;
font-size:14px;
font-family:Georgia, "URW Bookman L", serif;
margin:0;
line-height:25px;
text-align:left;
}
ul#menu li li a:hover, ul#menu li li a:active
{
background:#FFFFFF;
color:#cc3300;
}
ul#menu li ul
{
z-index:9999;
position:absolute;
left:-999em;
height:auto;
min-width:150px;
margin:0;
padding:0;
list-style-type:none;
}
ul#menu li ul a
{
min-width:120px;
}
ul#menu li ul ul
{
margin:-26px 0 0 150px;
}
ul#menu li:hover ul ul, ul#menu li:hover ul ul ul
{
left:-999em;
}
ul#menu li:hover ul, ul#menu li.sfhover ul, ul#menu li li:hover ul, ul#menu li li.sfhover ul, ul#menu li li li:hover ul, ul#menu li li li.sfhover ul
{
left: auto;
}
ul#menu li:hover, ul#menu li.sfhover
{
position: static;
}
我感谢任何帮助。谢谢!
答案 0 :(得分:3)
您的HTML包含一个迷路<?xml version="1.0"?>
,它应位于页面的非常顶部 。在您提供的网址上,您有<pi_page_head>
和<pi_page_foot>
等不存在的元素,并且您没有doctype,因此您的文档呈现为怪癖模式。
答案 1 :(得分:0)
我没看到你的css样式表连接的位置example link =“style.css”rel =“stylesheet”type =“text / css”&gt;
如果你的HTML页面上有你的css样式,那么它应该在open和close样式标签之间。 我试着为你编写关于第一个例子的代码,由于某种原因它将超链接删空了。在单词链接之前&lt;是在那里,然后链接然后一个空格和href和其他所有=“style.css”你会知道你的CSS附加到你的HTML页面。是的,我只是去了一个模板网站,你的css页面必须附加&lt; link href =“style.css”rel =“stylesheet”type =“type =”text / css“&gt;