Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

sub list behind menu

Posted on 2013-06-02
1
437 Views
Last Modified: 2013-06-03
Hi,

My sub menu doesnt display properly as it appears partly above and behind the the current link I am hovering on.

How do I fix this?
*{
    margin:0;
    padding:0;
	 list-style-type: none; 
}

/* FOR ANYTHING GREATER THAN MOBILE RESOLUTION */
@media screen and (min-width: 480px) {
  
   
    #nav-status {
        display: none;    
    }

    ul#mynav {
        width: 100%;    
        min-height: 25px;
        color:#fff;
        background:#CCC;
        overflow: visible;
    }

    ul#mynav li {
        color:#000;
        border-right: 1px solid #333;
        
        height: 21px;
        padding:2px;
        position: relative; 
		list-style-type: none;  
    }

    ul#mynav li:last-child {
        border-right: none;
    }

  

    ul#mynav li:hover ul {
        display: block;    
    }
	
	ul#mynav a {
		display:block;
		width: 100%;
		  color:#fff;
        background:#666;
       
	}
	
	  ul#mynav li ul {
       
	    display: none;
        
        color:#fff;
        background:#666;
        position: absolute; 
        top: 0px; 
        left: 50px;
        overflow: hidden;
    }
    .more{
        display:none;
    }
}


<ul id="mynav">
    <li><a href="#">Item 1</a></li>
    <li><a href="#">Item 2</a></li>
    <li><a href="#">Item 3</a></li>
    <li><a href="#">Item 4</a></li>
    <li>
        <a href="#">Item 5 <span class="more">></span></a>
        <ul>
            <li><a href="#">Sub Item 1</a></li>
            <li><a href="#">Sub Item 2</a></li>
            <li><a href="#">Sub Item 3</a></li>
        </ul>
    </li>
    <li><a href="#">Item 6</a></li>
    <li><a href="#">Item 7</a></li>
</ul>
</div>

Open in new window

0
Comment
Question by:jagguy
1 Comment
 
LVL 15

Accepted Solution

by:
Jagadishwor Dulal earned 500 total points
ID: 39215361
Change your style sheet to:

*{
    margin:0;
    padding:0;
	 list-style-type: none; 
}

/* FOR ANYTHING GREATER THAN MOBILE RESOLUTION */
@media screen and (min-width: 480px) {
  
   
    #nav-status {
        display: none;    
    }

    ul#mynav {
        width: 100%;    
        min-height: 25px;
        color:#fff;
        background:#CCC;
        overflow: visible;
    }

    ul#mynav li {
        color:#000;
        border-right: 1px solid #333;
        height: 21px;
        padding:2px;
		list-style-type: none;  
    }

    ul#mynav li:last-child {
        border-right: none;
    }

  

    ul#mynav li:hover ul {
        display: block;    
    }
	
	ul#mynav a {
		display:block;
		width: 100%;
		  color:#fff;
        background:#666;
       
	}
	
	  ul#mynav li ul {
       
	    display: none;
        
        color:#fff;
        background:#666;
        position: absolute; 
        left: 50px;
        overflow: hidden;
    }
    .more{
        display:none;
    }
}

Open in new window

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question