PDA

View Full Version : CSS Navigation Problem



notsean
Jan 27th, 2011, 01:10 PM
I am trying to create the navigation from this site: http://www.cougarsoftware.com/content/partners/overview.aspx in CSS. However, I have 2 problems.

1) getting the second (or third) column to always align to the top of the first
2) keeping the second column open when there are few items in the list ex: try choosing Partners and then a second column option.

This design is currently in Flash, and thus is not accessible, however, hovering over 'dead' space, area without links, the bottom of column 2 closes the column 2 nav

Thanks for any help!

HTML

<div id="access" role="navigation">
<div class="skip-link screen-reader-text"><a href="#content" title="Skip to content">Skip to content</a></div>
<div class="menu-header"><ul id="menu-level1" class="menu">
<li id="menu-item-34" class="menu-item menu-item-type-post_type menu-item-34">
<a href="http://localhost/wordpress/about/">About</a>
</li>
<li id="menu-item-30" class="menu-item menu-item-type-post_type current-page-ancestor current-menu-ancestor current_page_ancestor menu-item-30">
<a href="http://localhost/wordpress/products/">Products</a>
<ul class="sub-menu">
<li id="menu-item-29" class="menu-item menu-item-type-post_type current-page-ancestor current-menu-ancestor current-menu-parent current-page-parent current_page_parent current_page_ancestor menu-item-29">
<a href="http://localhost/wordpress/products/hand-tools/">Hand Tools</a>
<ul class="sub-menu">
<li id="menu-item-28" class="menu-item menu-item-type-post_type current-menu-item page_item page-item-14 current_page_item menu-item-28">
<a href="http://localhost/wordpress/products/hand-tools/hammers/">Hammers</a>
</li>
</ul>
</li>
</ul>
</li>
<li id="menu-item-33" class="menu-item menu-item-type-post_type menu-item-33">
<a href="http://localhost/wordpress/contact/">Contact</a>
<ul class="sub-menu">
<li id="menu-item-31" class="menu-item menu-item-type-post_type menu-item-31">
<a href="http://localhost/wordpress/contact/phone/">Phone</a>
</li>
<li id="menu-item-32" class="menu-item menu-item-type-post_type menu-item-32">
<a href="http://localhost/wordpress/contact/email/">Email</a>
</li>
</ul>
</li>
<li id="menu-item-27" class="menu-item menu-item-type-post_type menu-item-27">
<a href="http://localhost/wordpress/other/">Other</a>
</li>
</ul>
</div> </div><!-- #access -->

CSS

/* =Menu
-------------------------------------------------------------- */

#access {
background: #000;
display: block;
float: left;
margin: 0 auto;
/*width: 940px;*/
width: 192px;
}
#access .menu-header,
div.menu {
font-size: 13px;
margin-left: 12px;
/*width: 928px;*/
width: 180px;
}
#access .menu-header ul,
div.menu ul {
list-style: none;
margin: 0;
}
#access .menu-header li,
div.menu li {
/*float: left;*/
position: relative;
}
#access a {
color: #aaa;
display: block;
line-height: 38px;
padding: 0 10px;
text-decoration: none;
}
#access ul ul {
box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
-moz-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
-webkit-box-shadow: 0px 3px 3px rgba(0,0,0,0.2);
display: none;
position: absolute;
top: 0px;
left: 180px;
float: left;
width: 180px;
z-index: 99999;
}
#access ul ul li {
min-width: 180px;
}
#access ul ul ul {
left: 100%;
top: 0;
}
#access ul ul a {
background: #333;
line-height: 1em;
padding: 10px;
width: 160px;
height: auto;
}
#access li:hover > a,
#access ul ul :hover > a {
background: #333;
color: #fff;
}
#access ul li:hover > ul {
display: block;
}
#access ul li.current_page_item > a,
#access ul li.current-menu-ancestor > a,
#access ul li.current-menu-item > a,
#access ul li.current-menu-parent > a {
color: #fff;
}
* html #access ul li.current_page_item a,
* html #access ul li.current-menu-ancestor a,
* html #access ul li.current-menu-item a,
* html #access ul li.current-menu-parent a,
* html #access ul li a:hover {
color: #fff;
}