Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE7 and CSS - menu not working

Status
Not open for further replies.

AP81

Programmer
Apr 11, 2003
740
AU
Hi All,

I recently made a navigation menu bar for our company intranet. I have it working on IE and Firefox, however the menus do not drop down on IE7.

I think that the problem is related to the css style below, but have tried a nubmer of things with no success. I have also have a link to a zip file with all the files
here

If someone can help me out, I'd greatly appreciate it.

Code:
.menu ul li a, .menu ul li a:visited {
	display:block; 
	text-decoration:none; 
	width:144px; 
	text-align:center;
	color:#fff; 
	height:24px;
	line-height:22px;
	overflow:hidden;
	background-image: url(img/lev0_bg1.gif);
	background-color: #2C5F93;
}


------------------------------------
There's no place like 127.0.0.1
------------------------------------
 
Sorry for putting all my code in a zip and linking it externally. Here is my code

1. Main HTML
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="all" type="text/css" href="dropdown.css" />
<!--[if lte IE 6]>
<link rel="stylesheet" media="all" type="text/css" href="dropdown_ie.css" />
<![endif]-->
<title>Untitled Document</title>
</head>

<body style="margin-top:0px">
<div class="menu">

<ul>
<li><a class="hide" href="../menu/index.html">Home</a>

<!--[if IE]>
<a href="../menu/index.html">Home
<table><tr><td>
<![endif]-->


<!--[if IE]>
</td></tr></table>
</a>
<![endif]-->

</li>

<li><a class="hide" href="../new_etracker/etracker.php">eTracker</a>

<!--[if IE]>
<a href="index.html">eTracker
<table><tr><td>
<![endif]-->		

	<ul>
	<li><a href="../new_etracker/etracker.php" title="New eTracker">New eTracker</a></li>
	<li><a href="../etracker/all.php" title="Display All Events">Display All Events</a></li>
	<li><a href="../etracker/probnew.php" title="Display Equipment History">Display Equipment History</a></li>
	<li><a href="../etracker/print.php" title="Print Equipment History">Print Equipment History</a></li>
	<li><a href="../etracker/action.php" title="Display Action">Display Action</a></li>
	<li><a href="../etracker/warehouse.php" title="Ware - Equip History">Ware - Equip Hsitory</a></li>
	<li><a href="../etracker/waresitehistory.php" title="Ware - Site History">Ware - Site Hsitory</a></li>
	</ul>

<!--[if IE]>
</td></tr></table>
</a>
<![endif]-->

</li>

<li><a class="hide" href="../customview/customview.php">Music / Equip / Accounts</a>

<!--[if IE]>
<a href="../layouts/index.html">Music / Equip / Accounts
<table><tr><td>
<![endif]-->

<!--[if IE]>
</td></tr></table>
</a>
<![endif]-->

</li>

<li><a class="hide" href="../dispatch/reports.php">Dispatch Reports</a>

<!--[if IE]>
<a href="../boxes/index.html">Dispatch Reports
<table><tr><td>
<![endif]-->


<!--[if IE]>
</td></tr></table>
</a>
<![endif]-->

</li>

<li><a class="hide" href="#">Misc</a>

<!--[if IE]>
<a href="#">Misc
<table><tr><td>
<![endif]-->

	<ul>
	<li><a href="javascript:load();" title="Last Database Updates">Last Database Updates</a></li>
	</ul>

<!--[if IE]>
</td></tr></table>
</a>
<![endif]-->

</li>

</ul>

</div>

</body>
</html>

2. dropdown.css
Code:
/* common styling */
.menu {
	font-family: arial, sans-serif; 
	width:100%; 
	position:relative; 
	margin:0; 
	font-size:12px; 
	z-index:100;
	text-decoration : none;
	background-image: url(img/lev0_bg1.gif);
	border: 1px solid #336699;
	background-color: #2C5F93;
	height:24px;
}
.menu ul {padding:0; margin:0;list-style-type: none; }
.menu ul li a, .menu ul li a:visited {
	display:block; 
	text-decoration:none; 
	width:144px; 
	text-align:center;
	color:#fff; 
	height:24px;
	line-height:22px;
	overflow:hidden;
	background-image: url(img/lev0_bg1.gif);
	background-color: #2C5F93;
}
.menu ul li {float:left; margin-right:1px; position:relative;}
.menu ul li ul {display: none;}

/* specific to non IE browsers from here on*/
.menu ul li:hover a {
	text-decoration:none;
	background-image: url(img/lev0_bg2.gif);
	background-color: #2C5F93;
}
.menu ul li:hover ul {display:block; position:absolute; top:24px; left:0; width:105px;}
.menu ul li:hover ul li a.hide {background:#6a3; color:#fff;}
.menu ul li:hover ul li:hover a.hide {background:#6fc; color:#000;}            
.menu ul li:hover ul li ul {display: none;}
.menu ul li:hover ul li a {
	display:block; 
	width:170px; 
	background:#5286BB; 
	color:#ffffff; 
	text-align:left;
	padding-left:18px;
}
.menu ul li:hover ul li a:hover {
	background:#1A4D81; 
	color:#ffffff;	
	background-image: url(img/lev1_arrow.gif);
	background-repeat: no-repeat;}
.menu ul li:hover ul li:hover ul {display:block; position:absolute; left:105px; top:0;}
.menu ul li:hover ul li:hover ul.left {left:-105px;}



2. dropdown_ie.css
Code:
.menu ul li a.hide, .menu ul li a:visited.hide {display:none;}
.menu ul li a:hover ul li a.hide {display:none;}

.menu ul li a:hover {
	text-decoration:none;
	/*background-image: url(img/lev0_bg2.gif);*/
	background: #2C5F93;
}


.menu ul li a:hover ul {display:block; position:absolute; top:24px; left:0; width:105px;}
.menu ul li a:hover ul li a.sub {background:#6a3; color:#fff;}
.menu ul li a:hover ul li a {
	display:block; 
	width:170px;
	background:#5286BB; 
	color:#ffffff; 
	text-align:left;
	padding-left:18px;
}
.menu ul li a:hover ul li a ul {visibility:hidden;}
.menu ul li a:hover ul li a:hover {
	background:#1A4D81; 
	color:#ffffff;	
	background-image: url(img/lev1_arrow.gif);
	background-repeat: no-repeat;}	
}
.menu ul li a:hover ul li a:hover ul {visibility:visible; position:absolute; left:105px; top:0; color:#000;}
.menu ul li a:hover ul li a:hover ul.left {left:-105px;}


------------------------------------
There's no place like 127.0.0.1
------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top