Solved

sub list behind menu

Posted on 2013-06-02
1
432 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now