Note that there are some explanatory texts on larger screens.

plurals
  1. POCSS Dropdown Menu issues
    primarykey
    data
    text
    <p>Can anyone help with a small problem.</p> <p>I've got a nice simple CSS dropdown menu</p> <p><a href="http://www.cinderellahair.co.uk/new/CSSDropdown.html" rel="nofollow noreferrer">http://www.cinderellahair.co.uk/new/CSSDropdown.html</a></p> <p>The problem I have is when you rollover a menu item that has children which are wider than the content, it pushes the whole menu right.</p> <p>Aside of shortening the child menu links down, is there any tweak I can make to my CSS to stop this happening?</p> <p>CSS Code:</p> <pre><code> /* General */ #cssdropdown, #cssdropdown ul { list-style: none; } #cssdropdown, #cssdropdown * { padding: 0; margin: 0; } #cssdropdown {padding:43px 0px 0px 0px;} /* Head links */ #cssdropdown li.headlink { margin:0px 40px 0px -1px; float: left; background-color: #e9e9e9;} #cssdropdown li.headlink a { display: block; padding: 0px 0px 0px 5px; text-decoration:none; } #cssdropdown li.headlink a:hover { text-decoration:underline; } /* Child lists and links */ #cssdropdown li.headlink ul { display: none; text-align: left; padding:10px 0px 0px 0px; font-size:12px; float:left;} #cssdropdown li.headlink:hover ul { display: block; } #cssdropdown li.headlink ul li a { padding: 5px; height: 17px; } #cssdropdown li.headlink ul li a:hover { background-color: #333; } /* Pretty styling */ body { font-family:Georgia, "Times New Roman", Times, serif; font-size: 16px; } #cssdropdown a { color: grey; } #cssdropdown ul li a:hover { text-decoration: none; } #cssdropdown li.headlink { background-color: white; } #cssdropdown li.headlink ul { padding-bottom: 10px;} </code></pre> <p>HTML:</p> <pre><code> &lt;ul id="cssdropdown"&gt; &lt;li class="headlink"&gt;&lt;a href="http://www.cinderellahair.co.uk/new/index.php"&gt;HOME&lt;/a&gt;&lt;/li&gt; &lt;li class="headlink"&gt;&lt;a href="http://www.cinderellahair.co.uk/new/gallery/gallery.php"&gt;GALLERY&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://amazon.com/"&gt;CELEBRITY&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://ebay.com/"&gt;BEFORE &amp;amp; AFTER&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://craigslist.com/"&gt;HAIR TYPES&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li class="headlink"&gt;&lt;a href="http://www.cinderellahair.co.uk/new/about-cinderella-hair-extensions/about-us.php"&gt;ABOUT US&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://amazon.com/"&gt;WHY CHOOSE CINDERELLA&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://ebay.com/"&gt;TESTIMONIALS&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://craigslist.com/"&gt;MINI VIDEO CLIPS&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://craigslist.com/"&gt;OUR HAIR PRODUCTS&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li class="headlink"&gt;&lt;a href="http://www.cinderellahair.co.uk/new/news-and-offers/news.php"&gt;NEWS &amp;amp; OFFERS&lt;/a&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://amazon.com/"&gt;VERA WANG FREE GIVEAWAY&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://ebay.com/"&gt;CINDERELLA ON TV&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://craigslist.com/"&gt;CINDERELLA IN THE PRESS&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://craigslist.com/"&gt;CINDRELLA NEWSLETTERS&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li class="headlink"&gt;&lt;a href="http://www.cinderellahair.co.uk/new/cinderella-salon/salon-finder.php"&gt;SALON FINDER&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>JS Code:</p> <pre><code> $(document).ready(function(){ $('#cssdropdown li.headlink').hover( function() { $('ul', this).css('display', 'block'); }, function() { $('ul', this).css('display', 'none'); }); }); </code></pre> <p>Full code is on the link above, just view source.</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.
    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