No replies
ZMR_2019
ZMR_2019's picture
Offline
newbie
Last seen: 9 years 28 weeks ago
Timezone: GMT-5
Joined: 2011-01-18
Posts: 1
Points: 2

Hi all,

I'm new to this forum and am hoping to get a little help.

I have a drop down CSS/html menu that drops when an inline item is hovered on the main level.
I need to be able to have any of the items within the dropped list open a new menu as well.

I had a little success with it, but I kept running into problems. I can't seem to figure out where I went wrong, so I cleared the CSS slate back down to the original and I kept the nested two items within the dropdown item that I want to activate the hover/open (NEWS item, which is under the "Company" heading).

If anyone could help me understand why my outcome is not working, I would appreciate it.

=================HTML menu=======================

<ul> 
    <li class="active"><a href="/Default.asp">HOME</a></li>
 
    <li class="active"><a href="#">COMPANY</a>
    	<ul>
    	<li><a href="/CompanyOverview.asp">Overview</a></li>
        <li><a href="/Demo.asp">Flash Demo</a></li>
        <li><a href="/Mkt_USA.asp">Markets</a></li>
        <li><a href="/News.asp">News</a>
<!--This is where the nested menu starts-->
      <ul>
         <li><a href="/2010archive.asp">2010</a>
         <li><a href="/2011archive.asp">2011</a>
      </ul>
</li>
        <li><a href="/Careers.asp">Careers</a></li>
	<li><a href="/Partners.asp">Partners</a></li>
	</ul>
    </li>
 
    <li class="active"><a href="#">SERVICES</a>
    	<ul>
    	<li><a href="/LocalCable.asp">Cable</a></li>
        <li><a href="/Radio.asp">Radio</a></li>
        <li><a href="/BroadcastTV.asp">TV</a></li>
        <li><a href="/QualitativeResearch.asp">Qualitative Research</a></li> 
        <li><a href="/Newspaper.asp">Newspaper</a></li>
        <li><a href="/FreeTrial.asp">Free Trial</a></li>    			
        </ul>
    </li>
 
    <li class="active"><a href="#">TRAINING</a>
	<ul>
	<li><a href="/TrainingOverview.asp">Overview</a></li>
        <li><a href="/Schedule.asp">Schedule</a></li>
        </ul>
    </li>
 
    <li class="active"><a href="#">CONTACT</a>
	 <ul>
	 <li><a href="/Sales.asp">Sales</a></li>
         <li><a href="/Support.asp">Support</a></li>
         <li><a href="/MediaInquiry.asp">Media Inquiry</a></li>
         <li><a href="/WorldHeadquarters.asp">World Headquarters</a></li>
	 </ul>
    </li>
 
 
 
</ul>

=====================CSS==========================

#centeredmenu 
{
	clear:both;
	float:left;
	margin:0;
	padding:0;
	border-bottom:1px solid #c1c1c1;             /* logo blue line below menu #c1c1c1 */
	width:100%;
	font:100%;
        font-family:Verdana, Geneva, sans-serif;     /* Menu font */
	z-index:2;                                /* dropdown menus appear above the page content below */
	position:relative;
	text-align:center;
 
}
 
/* Top menu items */
#centeredmenu ul 
{
	margin:0;
	padding:0;
	list-style:none;
	float:right;
	position:relative;
	right:50%;
 
}
 
#centeredmenu ul li 
{
	margin:0 0 0 1px;
	padding:0;
	float:left;
	position:relative;
	left:50%;
	top:1px;
	text-align:left;
 
}
 
 
#centeredmenu ul li a 
{
	display:block;
	margin:0;
	padding:1em 1em .5em;
	font-size:1.1em;
	line-height:1em;
	background:#white;
	text-decoration:none;
	color:#444;
	font-weight:bold;
	border-bottom:0px solid #000;  /* Normal state Top menu underline colour */
}
 
#centeredmenu ul li.active a {
	color:#000;                     /* Normal state Top menu items font colour */
	background:transparent;         /* Normal state Top menu items background colour (logo blue)#1a7bb7 */ 
}
 
#centeredmenu ul li a:hover 
{
	background:white;                     /* Top menu items background colour */
	color:#000;
	border-bottom:0px solid #1a7bb7;   
}
 
#centeredmenu ul li:hover a,
#centeredmenu ul li.hover a 
{ /* This line is required for IE 6 and below */
	background:transparent;             /* Hovered Top menu items background colour */
	color:#88bbd4;                      /* Hovered Top menu text background colour */
	border-bottom:0px solid #1a7bb7;    /* Hovered state Top menu underline colour */
 
}
 
 
/* Submenu items */
#centeredmenu ul ul 
{
	display:none;            /* Sub menus are hiden by default */
	position:absolute;
	top:2.6em;               /* distance between main menu and sub menu */ 
	left:0;
	right:auto;             /*resets the right:50% on the parent ul */
	width:10em;              /* width of the drop-down menus */
}
 
#centeredmenu ul ul li 
{
	left:auto;             /*resets the left:50% on the parent li */
	margin:0;                /* Reset the 1px margin from the top menu */
	clear:left;
	width:100%;
}
 
 
#centeredmenu ul ul li a,
#centeredmenu ul li.active li a,
#centeredmenu ul li:hover ul li a,
#centeredmenu ul li.hover ul li a 
{ /* This line is required for IE 6 and below */
	font-size:1em;
	font-weight:normal;                    /* resets the bold set for the top level menu items */
	background:#fff;                         /* sub-menu background color */
	color:#444;
	line-height:1.5em;                      /* overwrite line-height value from top menu */
	border-bottom:1px solid #88bbd4;         /* sub menu item horizontal lines */
}
 
#centeredmenu ul ul li a:hover,
#centeredmenu ul li.active ul li a:hover,
#centeredmenu ul li:hover ul li a:hover,
#centeredmenu ul li.hover ul li a:hover 
{ /* This line is required for IE 6 and below */
	background:#88bbd4; /* Hovered Sub menu items background colour */
	color:#fff;
}
 
 
 
#socialicons
{
 
	margin:auto;
	width:75px;
	padding:0;
	position:relative;
	left:495px;
	top:7px;
	text-align:center;
	z-index:800;
 
}
 
#socialicons img#normalimg
 
{
border:none; 
text-decoration:none;
}
 
 
 
 
 
/* Flip the last submenu so it stays within the page */
#centeredmenu ul ul.last 
{
	left:auto; /* reset left:0; value */
	right:0; /* Set right value instead */
}
 
 
 
/* Make the sub menus appear on hover */
#centeredmenu ul li:hover ul,
#centeredmenu ul li.hover ul 
{ /* This line is required for IE 6 and below */
	display:block; /* Show the sub menus */
}