PDA

View Full Version : CSS Dropdown menu problem w/IE



jake7363
Dec 10th, 2008, 03:02 AM
Hi,
Not being all that experienced w/CSS, I downloaded a menu from an online bot for a site I am doing for a friend. The main line of the menu has 7 items, and not all those items have secondary menu items, but some have 4 or more.. There is the problem..


The menu works perfect in Firefox, but in IE 7, when I get to the third secondary menu item down, the dropdown part disappears. I am clueless as to what is going on...

Example

Item1 Item2
subItemA
subItemB ( -> OK to this point)
subItemC ( -> the dropdown disappears here..)
subItemD

Any and all help is greatly appreciated..

Thanks,
Jake

BoldUlysses
Dec 10th, 2008, 03:06 AM
Link to site? Code?

jake7363
Dec 10th, 2008, 03:17 AM
@charset "utf-8";
/* CSS Document */

/*^'^ Navigation Structure ^'^*/
.nav-container-outer{
background: #40435C;
padding: 0px;
height: 74px;
background: url(images/nav-bg.jpg);
}
.float-left{
float: left;
}
.float-right{
float: right;
}
.nav-container .divider{
display:block;
font-size:1px;
border-width:0px;
border-style:solid;
}
.nav-container .divider-vert{
float:left;
width:0px;
display: none;

}
.nav-container .item-secondary-title{
display:block;
cursor:default;
white-space:nowrap;
}
.clear{
font-size:1px;
height:0px;
width:0px;
clear:left;
line-height:0px;
display:block;
float:none;
}


.nav-container{
position:relative;
zoom:1;
margin: 0 auto;
}
.nav-container a, .nav-container li{
float:left;
display:block;
white-space:nowrap;
}
.nav-container div a, .nav-container ul a, .nav-container ul li{
float:none;
}
.nav-container ul{
left:-10000px;
position:absolute;
}
.nav-container, .nav-container ul{
list-style:none;
padding:0px;
margin:0px;
}
.nav-container li a{
float:none
}
.nav-container li{
position:relative;
}
.nav-container ul{
z-index:10;
}
.nav-container ul ul{
z-index:20;
}
.nav-container ul ul ul{
z-index:30;
}
.nav-container ul ul ul ul{
z-index:40;
}
.nav-container ul ul ul ul ul{
z-index:50;
}
li:hover>ul{
left:auto;
}
#nav-container ul {
top:80%;
}
#nav-container ul li:hover>ul{
top:0px;
left:100%;
}

/*^'^ Primary Items ^'^*/
#nav-container a{
padding:7px 0px 7px 0px;
margin: 10px 15px 0px 10px;
color: #605d97;
font-family: Trebuchet MS, Arial, sans-serif, Helvetica;
font-size:14px;
text-decoration:none;
font-weight: bold;
background: url(images/item-primary-bg.gif);
background-repeat: no-repeat;
background-position: top;
}

#nav-container a:hover{
color: #000000;
background: url(images/item-primary-bg.gif);
background-repeat: no-repeat;
background-position: center;
}

/*^'^ Secondary Items Container ^'^*/
#nav-container div, #nav-container ul {
padding:10px 4px 10px 4px;
margin:0px 0px 0px 0px;
background: url(images/item-secondary-container-bg.jpg);
background-repeat: repeat-x;
background-color: #A7AAC9;
border-bottom: 1px solid #A7AAB9
}

/*^'^ Secondary Items ^'^*/
#nav-container div a, #nav-container ul a{
padding:3px 10px 3px 6px;
background-color: #000000;
background: url(images/item-secondary-bg.jpg);
background-repeat: no-repeat;
background-position: 0px 22px;
font-size:11px;
border-width:0px;
border-style:none;
margin: 0px 0px 0px 0px;
width: 149px;
}

/*^'^ Secondary Items Hover State ^'^*/
#nav-container div a:hover, #nav-container ul a:hover{
background-color: #000000;
background: url(images/item-secondary-bg.jpg);
background-repeat: no-repeat;
color:#636882;
}

/*^'^ Secondary Item Titles ^'^*/
#nav-container .item-secondary-title{
cursor:default;
padding:4px 0px 3px 7px;
color: #636882;
font-family: Arial, Trebuchet MS, Arial, sans-serif, Helvetica;
font-size:11px;
/* background: url(images/item-secondary-title-bg.jpg); */
background-repeat: no-repeat;
font-weight:bold;
}


/*^'^ Horizontal Dividers ^'^*/
#nav-container .divider-horiz{
border-top-width:1px;
margin:5px 5px;
border-color: #3a3c52;
}

/*^'^ Vertical Dividers ^'^*/
#nav-container .divider-vert{
border-left-width:1px;
height:15px;
margin:4px 2px 0px 2px;
border-color:#AAAAAA;
}



HTML
<table width="678" height="31" border="0" align="center" cellpadding="0" cellspacing="0" id="Menu">
<tr>
<!-- Menu Content-->
<td><div class="nav-container-outer">
<ul id="nav-container" class="nav-container">
<li><a class="item-primary" href="indexX.html" target="_self">&nbsp;&nbsp;Home&nbsp;&nbsp; </a>
</li>
<li><span class="divider divider-vert" ></span></li>
<li><a class="item-primary" href="" target="_self">&nbsp;&nbsp;Store&nbsp;&nbsp;</a>
<ul style="width:150px;">
<li><a href="store.html" title="Music" target="_self" >Music</a></li>
<li><a href="storePlays" title="Plays" target="_self" >Plays</a></li>
<li><a href="http://www.dennycarleton.com/storeVideo.htm" title="Video" target="_self" >Video</a></li>
<li><a href="storeFree" title="Free" target="_self" >Free</a></li>
</ul>
</li>
<li><span class="divider divider-vert" ></span></li>
<li><a class="item-primary" href="" target="_self">Fun Stuff</a>
<ul style="width:150px;">
<li><a href="FavLinks.html" title="Favorite Links" target="_self">Favorite Links</a></li>
<li><a href="capMoments.htm" title="Photos" target="_self" >Photos</a></li>
<li><a href="FunStuff.html" title="Places" target="_self" >Places</a></li>

</ul>
</li>
<li><span class="divider divider-vert" ></span></li>
<li><a class="item-primary" href="" target="_self">History</a>
<ul style="width:150px;">
<li><a href="MusHis.htm" title="Musical History Tour" target="_self" >Musical History Tour</a></li>
<li><a href="LifeTimes.htm" title="Life and Times" target="_self" >Life and Times</a></li>
<li><a href="witness.htm" title="Witness" target="_self" >Witness</a></li>
</ul>
</li>
<li><span class="divider divider-vert" ></span></li>
<li><a class="item-primary" href="" target="_self">Wordsmithing</a>
<ul style="width:150px;">
<li><a href="QuickWord.htm" title="A Quick Word" target="_self" >A Quick Word</a></li>
<li><a href="say.htm" title="Somethig to Say" target="_self" >Somethig to Say</a></li>
<li><a href="reviews.htm" title="Clippings" target="_self" >Clippings</a></li>
</ul>
</li>
<li><span class="divider divider-vert" ></span></li>
<li><a href="onair.htm" target="_self" class="item-primary style1">On the Air</a>
</li>
<li><span class="divider divider-vert" ></span></li>

<li><a class="item-primary" href="" target="_self">Spotlight</a>
<ul style="width:150px;">
<li><a href="store.html" title="Music" target="_self" >The Elements</a></li>
<li><a href="storePlays" title="Plays" target="_self" >Other Artists</a></li>
<li><span class="submenu">Christian</li></span>
<li><a href="storeVideo.htm" title="Video" target="_self" >>Teen Challenge</a></li>
<li><a href="storeFree.htm" title="Free" target="_self" >The Fest</a></li>
</ul>
</li>
</ul>
<!-- Menu Content end -->
</div></td>
</tr>
</table>

BoldUlysses
Dec 10th, 2008, 05:29 AM
I don't have access to IE7 here at home (Mac and Linux only), but in the meantime, a couple of suggestions:

- Tables are bad for layout (http://phrogz.net/css/WhyTablesAreBadForLayout.html). Only use them for tabular data.
- Instead of pilfering code, consider building your own dropdown menu using the suckerfish tutorial (http://www.alistapart.com/articles/dropdowns/). You'll learn more by going through the steps yourself and streamline your CSS considerably (you have a lot of unnecessary code at the moment).

jake7363
Dec 10th, 2008, 05:39 AM
I understand about weaning from tables...I have read much about the topic and that is why I am trying to forge ahead with CSS. I also understand that because I am new to the game, I am also not efficient.

I am grateful for the suggestion and I am going to take you up on that. While I am grasping some concepts, there are many more out there - again, based on what I am reading.

My preference is to do my own, so this is a good start.

Thanks again!

Jake

AmmO
Dec 10th, 2008, 10:34 AM
oh and please place your code using in code brackets [!code] [!/code] without the exclamation marks makes it much easier to read and help

abduraooft
Dec 10th, 2008, 10:41 AM
@jake7363, don't you have some javascript code targeted for IE's hover effect? We need you complete code(including DOCTYPE) to have a test at our end. Or a ink to your page would be better!

hkp819
Dec 10th, 2008, 12:31 PM
Hi,
I downloaded a menu from an online bot for a site I am doing for a friend.
The main line of the menu has 7 items, and not all those items have secondary menu items, but some have 4 or more.. There is the problem..

The menu works perfect in Firefox, but in IE 7, when I get to the third secondary menu item down, the dropdown part disappears. I am clueless as to what is going on...

Example

Item1 Item2
subItemA
subItemB ( -> OK to this point)
subItemC ( -> the dropdown disappears here..)
subItemD

Any and all help is greatly appreciated..

Thanks,
Jake