Note that there are some explanatory texts on larger screens.

plurals
  1. POSub-menu in css drop down disappears before Hover when menu wraps according to width
    primarykey
    data
    text
    <p>I am having trouble with Drop down menu. When the content of navigation wraps according to its width and the situation when menu items stacks on one another, at this time the sub menu appears at a certain distance from it and disappears before i hover on it. Help! I am working on this code. Fiddle is linked below.</p> <pre><code>&lt;nav&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Menu1&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Option1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Option2&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Option3&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Sub-option1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Sub-option2&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Menu2&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="#"&gt;Option1&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Option2&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Menu3&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p></p> <p>CSS:</p> <pre><code> nav ul ul { display: none; } nav ul li:hover &gt; ul { display: block; } nav ul { box-shadow: 0px 0px 9px rgba(0,0,0,0.15); padding: 0 20px; list-style: none; position: relative; display: inline-table; } nav ul:after { content: ""; clear: both; display: block; } nav ul li { float: left; } nav ul li:hover { background: #4b545f; background: linear-gradient(top, #4f5964 0%, #5f6975 40%); background: -moz-linear-gradient(top, #4f5964 0%, #5f6975 40%); background: -webkit-linear-gradient(top, #4f5964 0%,#5f6975 40%); } nav ul li:hover a { color: #fff; } nav ul li a { display: block; padding: 25px 40px; color: #757575; text-decoration: none; } nav ul ul { background: #5f6975; border-radius: 0px; padding: 0; position: absolute; top: 100%; } nav ul ul li { float: none; border-top: 1px solid #6b727c; border-bottom: 1px solid #575f6a; position: relative; } nav ul ul li a { padding: 15px 40px; color: #fff; } nav ul ul li a:hover { background: #4b545f; } nav ul ul ul { position: absolute; left: 100%; top:0; } </code></pre> <p><a href="http://jsfiddle.net/sagarguhe/xhABB/2/" rel="nofollow">Fiddle</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload