php Menu

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fernandizo
Forum Newbie
Posts: 2
Joined: Mon Mar 01, 2010 11:55 am

php Menu

Post by fernandizo »

Hey guys, I'm new here. got a question:

I got this menu.php file and it looks great on firefox and safari but IE looks like garbage. the background image doesn't display and the dropdown doesn't exisit. Anybody know whats going on here? here is the coding:(I am thinking something to do with css not being parsed correctly..maybe??). Thanks for the help guys.


<style type="text/css">

/* ================================================================
This copyright notice must be untouched at all times.

The original version of this stylesheet and the associated (x)html
is available at http://www.cssplay.co.uk/menus/final_drop.html
Copyright (c) 2005-2008 Stu Nicholls. All rights reserved.
This stylesheet and the associated (x)html may be modified in any
way to fit your requirements.
=================================================================== */

.menu {
width:997px;
height:32px;
position:relative;
z-index:100;
font-family:arial, sans-serif;

}

/* hack to correct IE5.5 faulty box model */
* html .menu {
width:998px;
w\idth:997px;
}

/* remove all the bullets, borders and padding from the default list styling */
.menu ul {
padding:0;
margin:0;
list-style-type:none;

}
.menu ul ul {
width:199px;


}

/* float the list to make it horizontal and a relative positon so that you can control the dropdown menu positon */
.menu li {
float:left;
width:199px;
position:relative;
}

/* style the links for the top level */
.menu a, .menu a:visited {
display:block;
font-size:12px;
text-decoration:none;
color: #666666;
width:199px;
height:30px;
border: 1px solid #666666;
border-width:1px 0px 1px 0px;
background-image:url(TestImage/button.jpg);
padding-left:10px;
line-height:29px;
font-weight:bold;
}

/* a hack so that IE5.5 faulty box model is corrected */
* html .menu a, * html .menu a:visited {
width:199px;
w\idth:180px;
background-image:url(TestImage/button.jpg);
}

/* style the second level background */
.menu ul ul a.drop, .menu ul ul a.drop:visited {
background:#d4d8bd url(http://www.cssplay.co.uk/menus/breadcru ... -arrow.gif) no-repeat 200px center;
}

/* style the second level hover */
.menu ul ul a.drop:hover {
background:#c9ba65 url(http://www.cssplay.co.uk/menus/breadcru ... -arrow.gif) no-repeat 200px center;
}
.menu ul ul :hover > a.drop {
background:#c9ba65 url(http://www.cssplay.co.uk/menus/breadcru ... -arrow.gif) no-repeat 200px center;

}

/* style the third level background */
.menu ul ul ul a, .menu ul ul ul a:visited {
background: #666666 ;
}

/* style the third level hover */
.menu ul ul ul a:hover {
background: #666666;
}


/* hide the sub levels and give them a positon absolute so that they take up no room */
.menu ul ul {
visibility:hidden;
position:absolute;
height:0;
top:31px;
left:-2px;
width:199px;

border-top:1px solid #666666;
}

/* another hack for IE5.5 */
* html .menu ul ul {
top:30px;
t\op:31px;
}

/* position the third level flyout menu */
.menu ul ul ul{
left:170px;
top:-1px;
width:170px;
}

/* position the third level flyout menu for a left flyout */
.menu ul ul ul.left {
left:-200px;
}

/* style the table so that it takes no ppart in the layout - required for IE to work */
.menu table {
position:absolute;
top:0;
left:0;
border-collapse:collapse;;
}

/* style the second level links */
.menu ul ul a, .menu ul ul a:visited {
background: #666666;
color: #FFFFFF;
height:auto;
line-height:1em;
padding:10px 10px;
width:180px;
border-width:0 1px 1px 1px;

}

/* yet another hack for IE5.5 */
* html .menu ul ul a, * html .menu ul ul a:visited {
width:200px;
w\idth:180px;
}

/* style the top level hover */
.menu a:hover, .menu ul ul a:hover{
color: #990000;
background: #CCCCCC;
}
.menu :hover > a, .menu ul ul :hover > a {
color: #FFFFFF;
background: #666666;
}

/* make the second level visible when hover on first level list OR link */
.menu ul li:hover ul,
.menu ul a:hover ul{
visibility:visible;
}

/* keep the third level hidden when you hover on first level list OR link */
.menu ul :hover ul ul{
visibility:hidden;
}

/* make the third level visible when you hover over second level list OR link */
.menu ul :hover ul :hover ul{
visibility:visible;
}

</style>


<div class="menu">

<ul>
<li><a href="?page=home">Home<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul>
<li><a href="?page=about">About us</a></li>
<li><a href="?page=news">News</a></li>

<?php if($session->checkSession()): ?>
<li><a href="?page=logout">Log Out</a></li>
<li><a href="?page=account_settings">Account Settings</a></li>
<?php else: ?>
<li><a href="?page=login">Log In</a></li>
<?php endif; ?>
<?php if($session->getLevel() == 1): ?>
<li><a href="?page=cp">Admin CP</a></li>
<?php endif; ?>

</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>

<li><a href="?page=Projects">Future Jobs Projects</a></li>

<li><a href="?page=internships">Internship Program<!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul>
<li><a href="?page=internships&for=1">Internship Opportunities</a></li>

<li><a href="?page=programs">Educational Programs</a></li>

<li><a href="?page=forms">Forms</a></li>

<li><a href="?page=interns">Meet our Interns</a></li>

</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>

<li><a href="?page=partners">Our Partners</a><!--[if IE 7]><!--></a><!--<![endif]-->
<!--[if lte IE 6]><table><tr><td><![endif]-->
<ul>
<li><a href="?page=partners#educational">Educational Institutions</a></li>
<li><a href="?page=partners#employers">Employers</a></li>
</ul>
<!--[if lte IE 6]></td></tr></table></a><![endif]-->
</li>

<li><a href="?page=contact_us">Contact us</a></li>


</ul>

</div>
lshaw
Forum Commoner
Posts: 69
Joined: Mon Apr 20, 2009 3:40 pm
Location: United Kingdom

Re: php Menu

Post by lshaw »

Do you have a <!DOCTYPE> declaration? and html tags? or is that all of your code?
User avatar
JNettles
Forum Contributor
Posts: 228
Joined: Mon Oct 05, 2009 4:09 pm

Re: php Menu

Post by JNettles »

This is not a PHP problem but rather a CSS one and my recommendation is that you download the excellent Firebug extension for Firefox and use it to help you tweak your CSS for compatibility. Nothing hurts worse than balancing cross-browser problems but sadly we must all play Microsoft's game.
Post Reply