I have a 3-level deep, unordered list I’m styling to create a drop-down menu to extend this 2-level simple drop-down menu. The CSS is as follows:
@CHARSET "ISO-8859-1";
/* menu styles */
/* Top-level (Styles Works) */
#jsddm
{ margin: 0;
padding: 0}
#jsddm li
{ float: left;
list-style: none;
font: 12px Tahoma, Arial;}
#jsddm li a
{ display: block;
/*background: #324143; Old Style*/
background: -webkit-linear-gradient(top, rgba(238,238,238,1) 0%,rgba(204,204,204,1) 100%); /* Chrome10+,Safari5.1+ */;
padding: 5px 12px;
text-decoration: none;
border-right: 1px solid white;
width: 70px;
/*color: #EAFFED; Default color*/
color: #000099;
white-space: nowrap;}
#jsddm li a:hover
{ background: #24313C}
/* 2nd-level (Styles Works) */
#jsddm li ul
{ margin: 0;
padding: 0;
position: absolute;
visibility: visible;
border-top: 1px solid white}
#jsddm li ul li
{ float: none;
display: inline}
#jsddm li ul li a
{ width: auto;
background: #dfeffc;
color: #24313C}
#jsddm li ul li a:hover
{ background: #5c9ccc}
/* 3rd-level (Doesn't apply styles) */
#jsddm li ul li ul
{ margin: 0;
padding: 0;
position: absolute;
visibility: hidden;
border-top: 2px solid green}
The styling works for the first two levels, but not for the 3rd, I’m not sure if I have the syntax correct or if there’s something else I’m missing. The html is as follows:
<div id="dropDownDiv">
<ul id="jsddm">
<li><a class="btn" href="#">Top Item 1</a>
<ul>
<li><a id="" class="btn" href="#">2nd Level Item 1</a></li>
<li><a href="#">2nd Level Item 2</a></li>
</ul>
</li>
<li><a class="btn" href="#">Top Item 2</a>
<ul>
<li><a id="" class="btn hide" href="#">2nd Level Item 1</a></li>
<ul>
<li><a id="" class="btn hide" href="#">3rd Level Item 1</a></li>
<li><a id="" class="btn" href="#">3rd Level Item 1</a></li>
</ul>
<li><a id="" class="btn" href="#">2nd Level Item 1</a></li>
</ul>
</li>
</ul>
</div>
Any suggestions are appreciated.
UPDATE:
Thanks for loaning me your eyes Gareth. Corrected html:
<ul id="jsddm">
<li><a class="btn" href="#">Top Item 1</a>
<ul>
<li><a id="" class="btn" href="#">2nd Level Item 1</a></li>
<li><a href="#">2nd Level Item 2</a></li>
</ul>
</li>
<li><a class="btn" href="#">Top Item 2</a>
<ul>
<li><a id="" class="btn hide" href="#">2nd Level Item 1</a>
<ul>
<li><a id="" class="btn hide" href="#">3rd Level Item 1</a></li>
<li><a id="" class="btn" href="#">3rd Level Item 1</a></li>
</ul>
</li>
<li><a id="" class="btn" href="#">2nd Level Item 1</a></li>
</ul>
</li>
</ul>
Your third level
ulis not contained within anli. That might be causing your problem.