I have this test code that just supposes to show a menu and then collapse it on click. Well it works fine in IE 6.0 but in Firefox I have issues. The menu does open and collapse BUT the size of the layer doesn't change therefore I have overlapping layers.
Any ideas how can I fix that? I think my problem is with this piece of code
height: 6em;. I am new to CSS, so style sheet I use is my company's standard and I have no clue what they do.
This is my entire code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Test</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
div.BodyHeader,
div.BodyFooter {
width: 98%;
height: 10em;
}
div.BodyHeader {
background: url(../images/logo_modified.gif) no-repeat;
}
div.BodyMain {
float: left;
width: 98%;
background: #e5e5db;
}
div.BodyLeft,
div.BodyRight {
float: left;
width: 49%;
text-align: center;
}
div.BodyRight {
float: right;
}
.BodyBox {
background: #feffed;
width: 90%;
height: 6em;
text-align: left;
border: 1px solid silver;
margin: 1em;
padding: 0 0 0 0.5em ;
}
.BodyBox h1 {
height: 30px;
padding: 0.5em 0 0 40px;
font-size: 1.5em;
color: #056100;
font-weight: bold;
margin: 0;
}
.BodyBox h1.A {
background: url(../images/pic_Analysis.gif) no-repeat 0 5px;
}
.BodyBox h1.P {
background: url(../images/pic_Planning.gif) no-repeat 0 5px;
}
.BodyBox h1.I {
background: url(../images/pic_Interaction.gif) no-repeat 0 5px;
}
.BodyBox h1.M {
background: url(../images/pic_Measurement.gif) no-repeat 0 5px;
}
.BodyBoxPink {
background: #ffeeee;
}
.BodyBoxBlue {
background: #AFEEEE;
}
.BodyBoxGreen {
background: #F5FFE6;
}
a.ButtonLogout:LINK,
a.ButtonLogout:VISITED,
a.ButtonLogout:ACTIVE {
float: right;
background: url(../images/btn_logout_off.gif) no-repeat;
height: 125px;
width: 74px;
text-align: center;
text-decoration: none;
padding: 7px 0 0;
font-weight: bold;
color: #056100;
}
a.ButtonLogout:HOVER {
background: url(../images/btn_logout_on.gif) no-repeat;
}
a.Kenna {
float: right;
background: url(../images/pic_PoweredByKenna.gif) no-repeat;
height: 17px;
width: 177px;
padding: 7px 0 0;
font-weight: bold;
color: #000000;
}
/* Put this inside a @media qualifier so Netscape 4 ignores it */
/* @media screen, print { */
/* Turn off list bullets */
ul.mktree li { list-style: none; color: blue; }
/* Control how "spaced out" the tree is */
ul.mktree, ul.mktree ul, ul.mktree li { margin-left:10px; padding:0px; }
ul.mktree ul { color: black; padding-left: 10px; }
/* Provide space for our own "bullet" inside the LI */
ul.mktree li .bullet { padding-left: 15px; }
/* Show "bullets" in the links, depending on the class of the LI that the link's in */
ul.mktree li.liOpen .bullet { cursor: pointer; background: url(/images/mktree_minus.gif) center left no-repeat; }
ul.mktree li.liClosed .bullet { cursor: pointer; background: url(/images/mktree_plus.gif) center left no-repeat; }
ul.mktree li.liBullet .bullet { cursor: default; background: url(/images/mktree_bullet.gif) center left no-repeat; }
/* Sublists are visible or not based on class of parent LI */
ul.mktree li.liOpen ul { display: block; }
ul.mktree li.liClosed ul { display: none; }
/* Format menu items differently depending on what level of the tree they are in */
ul.mktree li { font-size: 12px; }
ul.mktree li ul li { font-size: 12px; }
ul.mktree li ul li ul li { font-size: 12px; }
ul.mktree li ul li ul li ul li { font-size: 12px; }
/* } */
.BodyInactive {color: #AAAAAA;}
.CellHeader {
color: #FFFFFF;
background-color: #666666;
text-align: center;
}
.CellYellow,
.CellGreyLite,
.CellGreyDark,
.CellWhite {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #666666;
background-color: #E6E6C8; /*lite yellow*/
text-align: center;
}
.CellGreyLite {
background-color: #CCCCCC; /*lite grey*/
}
.CellGreyDark {
background-color: #999999; /*dark grey*/
}
.CellWhite {
background-color: #FFFFFF; /*white*/
}
.TextRed {color: #FF0000}
INPUT, SELECT, TEXTAREA {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
padding: 1px;
border: 1px solid #000000;
}
</style>
</head>
<script>
var swtchMenu1=0;
function showOption(val)
{
if (swtchMenu1==0)
{
document.getElementById(val).style.display="block";
swtchMenu1=1;
document.getElementById("img1").src =http://www.webdeveloper.com/forum/archive/index.php/"images/mktree_minus.gif";
} else {
document.getElementById(val).style.display="none";
swtchMenu1=0;
document.getElementById("img1").src =http://www.webdeveloper.com/forum/archive/index.php/"images/mktree_plus.gif";
}
}
</script>
<body>
<div class="BodyLeft">
<div class="BodyBox">
<ul class="mktree">
<li><a href=http://www.webdeveloper.com/forum/archive/index.php/"" onClick="showOption('menu1');return false;">
<img src=http://www.webdeveloper.com/forum/archive/index.php/"images/mktree_plus.gif" border="0" id="img1"></a>First Button</li>
<ul id="menu1" style="display:none" type="square">
<li>First Option</li>
<li>Second Option</li>
</ul>
<li><img src=http://www.webdeveloper.com/forum/archive/index.php/"images/mktree_plus.gif" border="0">Second Button</li>
</ul>
</div>
<div class="BodyBox BodyBoxPink">
<ul class="mktree">
<li class="liOpen">First Button</li>
<li class="liOpen">Second Button</li>
</ul>
</div>
</div>
<div class="BodyRight">
<div class="BodyBox BodyBoxBlue">
<ul class="mktree">
<li class="liOpen">First Button</li>
<li class="liOpen">Second Button</li>
</ul>
</div>
<div class="BodyBox BodyBoxGreen">
<ul class="mktree">
<li class="liOpen">First Button</li>
<li class="liOpen">Second Button</li>
</ul>
</div>
</div>
</body>
</html>The height: 6em; restricts the layer in FF. Removing the height will allow the parent layer of the menu to expand.
Any ideas how can I fix that? I think my problem is with this piece of code
height: 6em;. I am new to CSS, so style sheet I use is my company's standard and I have no clue what they do.
This is my entire code
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Test</title>
<style>
body {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
}
div.BodyHeader,
div.BodyFooter {
width: 98%;
height: 10em;
}
div.BodyHeader {
background: url(../images/logo_modified.gif) no-repeat;
}
div.BodyMain {
float: left;
width: 98%;
background: #e5e5db;
}
div.BodyLeft,
div.BodyRight {
float: left;
width: 49%;
text-align: center;
}
div.BodyRight {
float: right;
}
.BodyBox {
background: #feffed;
width: 90%;
height: 6em;
text-align: left;
border: 1px solid silver;
margin: 1em;
padding: 0 0 0 0.5em ;
}
.BodyBox h1 {
height: 30px;
padding: 0.5em 0 0 40px;
font-size: 1.5em;
color: #056100;
font-weight: bold;
margin: 0;
}
.BodyBox h1.A {
background: url(../images/pic_Analysis.gif) no-repeat 0 5px;
}
.BodyBox h1.P {
background: url(../images/pic_Planning.gif) no-repeat 0 5px;
}
.BodyBox h1.I {
background: url(../images/pic_Interaction.gif) no-repeat 0 5px;
}
.BodyBox h1.M {
background: url(../images/pic_Measurement.gif) no-repeat 0 5px;
}
.BodyBoxPink {
background: #ffeeee;
}
.BodyBoxBlue {
background: #AFEEEE;
}
.BodyBoxGreen {
background: #F5FFE6;
}
a.ButtonLogout:LINK,
a.ButtonLogout:VISITED,
a.ButtonLogout:ACTIVE {
float: right;
background: url(../images/btn_logout_off.gif) no-repeat;
height: 125px;
width: 74px;
text-align: center;
text-decoration: none;
padding: 7px 0 0;
font-weight: bold;
color: #056100;
}
a.ButtonLogout:HOVER {
background: url(../images/btn_logout_on.gif) no-repeat;
}
a.Kenna {
float: right;
background: url(../images/pic_PoweredByKenna.gif) no-repeat;
height: 17px;
width: 177px;
padding: 7px 0 0;
font-weight: bold;
color: #000000;
}
/* Put this inside a @media qualifier so Netscape 4 ignores it */
/* @media screen, print { */
/* Turn off list bullets */
ul.mktree li { list-style: none; color: blue; }
/* Control how "spaced out" the tree is */
ul.mktree, ul.mktree ul, ul.mktree li { margin-left:10px; padding:0px; }
ul.mktree ul { color: black; padding-left: 10px; }
/* Provide space for our own "bullet" inside the LI */
ul.mktree li .bullet { padding-left: 15px; }
/* Show "bullets" in the links, depending on the class of the LI that the link's in */
ul.mktree li.liOpen .bullet { cursor: pointer; background: url(/images/mktree_minus.gif) center left no-repeat; }
ul.mktree li.liClosed .bullet { cursor: pointer; background: url(/images/mktree_plus.gif) center left no-repeat; }
ul.mktree li.liBullet .bullet { cursor: default; background: url(/images/mktree_bullet.gif) center left no-repeat; }
/* Sublists are visible or not based on class of parent LI */
ul.mktree li.liOpen ul { display: block; }
ul.mktree li.liClosed ul { display: none; }
/* Format menu items differently depending on what level of the tree they are in */
ul.mktree li { font-size: 12px; }
ul.mktree li ul li { font-size: 12px; }
ul.mktree li ul li ul li { font-size: 12px; }
ul.mktree li ul li ul li ul li { font-size: 12px; }
/* } */
.BodyInactive {color: #AAAAAA;}
.CellHeader {
color: #FFFFFF;
background-color: #666666;
text-align: center;
}
.CellYellow,
.CellGreyLite,
.CellGreyDark,
.CellWhite {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
color: #666666;
background-color: #E6E6C8; /*lite yellow*/
text-align: center;
}
.CellGreyLite {
background-color: #CCCCCC; /*lite grey*/
}
.CellGreyDark {
background-color: #999999; /*dark grey*/
}
.CellWhite {
background-color: #FFFFFF; /*white*/
}
.TextRed {color: #FF0000}
INPUT, SELECT, TEXTAREA {
font-family: Arial, Helvetica, sans-serif;
font-size: 10px;
padding: 1px;
border: 1px solid #000000;
}
</style>
</head>
<script>
var swtchMenu1=0;
function showOption(val)
{
if (swtchMenu1==0)
{
document.getElementById(val).style.display="block";
swtchMenu1=1;
document.getElementById("img1").src =http://www.webdeveloper.com/forum/archive/index.php/"images/mktree_minus.gif";
} else {
document.getElementById(val).style.display="none";
swtchMenu1=0;
document.getElementById("img1").src =http://www.webdeveloper.com/forum/archive/index.php/"images/mktree_plus.gif";
}
}
</script>
<body>
<div class="BodyLeft">
<div class="BodyBox">
<ul class="mktree">
<li><a href=http://www.webdeveloper.com/forum/archive/index.php/"" onClick="showOption('menu1');return false;">
<img src=http://www.webdeveloper.com/forum/archive/index.php/"images/mktree_plus.gif" border="0" id="img1"></a>First Button</li>
<ul id="menu1" style="display:none" type="square">
<li>First Option</li>
<li>Second Option</li>
</ul>
<li><img src=http://www.webdeveloper.com/forum/archive/index.php/"images/mktree_plus.gif" border="0">Second Button</li>
</ul>
</div>
<div class="BodyBox BodyBoxPink">
<ul class="mktree">
<li class="liOpen">First Button</li>
<li class="liOpen">Second Button</li>
</ul>
</div>
</div>
<div class="BodyRight">
<div class="BodyBox BodyBoxBlue">
<ul class="mktree">
<li class="liOpen">First Button</li>
<li class="liOpen">Second Button</li>
</ul>
</div>
<div class="BodyBox BodyBoxGreen">
<ul class="mktree">
<li class="liOpen">First Button</li>
<li class="liOpen">Second Button</li>
</ul>
</div>
</div>
</body>
</html>The height: 6em; restricts the layer in FF. Removing the height will allow the parent layer of the menu to expand.