SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Jul 2013
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    CSS drop-down menu hides behind content

    Hi,

    I am having a problem similar to some other people with this, but I've done hours of research and nothing I've found has worked! Hopefully someone here will have some insight....

    My drop-down CSS menu hides behind the other content on the page - it's just text - no videos or pictures or anything like that.

    The site isn't live yet, so I can't post a link, but I did run an example on a suggestion from someone else - the menu looks/works fine here, but there's no content on the page to interfere.... Here is the example link: http://jsfiddle.net/R3KcV/embedded/result/

    Here is the code:

    HTML Code:

    HTML Code:
    <div id='cssmenu'>
    <ul>
       <li class='has-sub'><a href='home.html'><span>Home</span></a>
      <ul>
             <li><a href='resources.html'><span>Resources</span></a></li>
        <li><a href='products.html'><span>Products</span></a></li>
        <li class='last'><a href='contact.html'><span>Contact Us</span></a></li>
          </ul>
      </li>
       <li class='has-sub'><a href='health-wellness.html'><span>Health & Wellness</span></a>
          <ul>
             <li><a href='cooking-from-scratch.html'><span>Cooking From Scratch</span></a></li>
             <li><a href='sustainable-gardening.html'><span>Sustainable Gardening</span></a></li>
             <li><a href='csa.html'><span>Community Supported Agriculture</span></a></li>
             <li><a href='fun-ways-to-exercise.html'><span>Fun Ways to Exercise</span></a></li>
             <li><a href='pain-relief.html'><span>Natural Relief for Chronic Pain</span></a></li>
             <li class='last'><a href='toxic-load.html'><span>Reducing Your Toxic Load</span></a></li>
          </ul>
       </li>
       <li><a href='relationships.html'><span>Relationships</span></a></li>
       <li><a href='wealth.html'><span>Wealth</span></a></li>
       <li class='last'><a href='spirituality.html'><span>Spirituality</span></a></li>
    </ul>
    </div>
    And here is the CSS:

    Code:
    #cssmenu:before, 
    #cssmenu:after, 
    #cssmenu > ul:before, 
    #cssmenu > ul:after {
    
    	content: '';
    	display: table;
    	
    }
    
    
    #cssmenu:after, #cssmenu > ul:after {
    
    	clear: both;
    	
    }
    #cssmenu
    {
    	zoom: 1;
    }
    
    #cssmenu > ul
    {
    	background: #00305f;
    	margin: 0;
    	padding: 0;
    	position: relative;
    }
    
    #cssmenu > ul li
    {
    	margin: 0;
    	padding: 0;
    	list-style: none;
      
    }
    
    #cssmenu > ul > li
    {
    	float: left;
    	position: relative;
    }
    
    #cssmenu > ul > li > a
    {
    	padding: 20px 25px;
    	display: block;
    	color: white;
    	font-family: Georgia, Times, Serif;
    	font-size: 20px;
    	text-transform: capitalize;
    	text-decoration: none;
    	text-shadow: 0 -1px 0 rgba(151, 99, 33, .43);
    	line-height: 18px;
    }
    
    #cssmenu > ul > li:hover > a
    {
    	background: #5783af;
    
    }
    
    #cssmenu > ul > li > a > span
    {
    	line-height: 18px;
    }
    
    #cssmenu > ul > li.active > a
    {
    	background: #5783af;
    }
    
    #cssmenu > ul > li > a:active
    {
    	background: #5783af;
    }
    
    #cssmenu > ul ul
    {
    	opacity: 0;
    	visibility: hidden;
    	position: absolute;
    	top: 120px;
    	background: #00305f;
    	margin: 0;
    	padding: 0;
    	z-index: 2000;
    	-webkit-transition: all .35s .2s ease-in-out;
    	-moz-transition: all .35s .2s ease-in-out;
    	-ms-transition: all .35s .2s ease-in-out;
    	transition: all .35s .2s ease-in-out;
    }
    
    #cssmenu > ul li:hover ul
    {
    	opacity: 1;
    	visibility: visible;
    	margin: 0;
    	color: #5783af;
    	z-index: 2000;
    	top: 64px;
    	left: 0;
    }
    
    #cssmenu > ul ul:before
    {
    	content: '';
    	position: absolute;
    	top: -10px;
    	width: 100%;
    	height: 16px;
    	background: transparent;
    }
    
    #cssmenu > ul ul li
    {
    	list-style: none;
    	padding: 0;
    	margin: 0;
    	width: 100%;
    }
    
    #cssmenu > ul ul li a
    {
    	padding: 12px 20px;
    	display: block;
    	color: white;
    	font-family: Georgia, Times, Serif;
    	font-size: 16px;
    	text-transform: capitalize;
    	text-decoration: none;
    	width: 175px;
    	border-left: 4px solid transparent;
    	-webkit-transition: all .35s ease-in-out;
    	-moz-transition: all .35s ease-in-out;
    	-ms-transition: all .35s ease-in-out;
    	transition: all .35s ease-in-out;
    	text-shadow: 0 -1px 0 rgba(151, 99, 33, .43);
    }
    
    #cssmenu > ul ul li a:hover
    {
    	border-left: 4px solid #055988;
    	background: #5783af;
    }
    
    #cssmenu > ul ul li a:active
    {
    	background: #5783af;
    }


    Thanks in advance for any helpful suggestions! Oh, and by the way, I'm using Firefox.
    Rose.
    Last edited by myssflame; Jul 7, 2013 at 16:26. Reason: forgot to include something

  2. #2
    It's all Geek to me silver trophybronze trophy
    ralph.m's Avatar
    Join Date
    Mar 2009
    Location
    Melbourne, AU
    Posts
    23,598
    Mentioned
    411 Post(s)
    Tagged
    7 Thread(s)
    Hi myssflame. Welcome to the forums.

    Your example doesn't demonstrate the problem, which makes it harder to suggest what to do. Anyhow, one thing you could try is adding position: relative here:

    Code:
    #cssmenu {
    zoom: 1;
    z-index: 9999 !important;
    position: relative;
    }
    If that doesn't work, add pos:rel and x-index to whatever is the outermost container of the menu.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •