Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>A drop down menu works by hovering over a button which in turn causes an action to happen. If there is white space in between the action is cancelled in moving away from it. This means that what you are trying to do cannot in practice be done. The solution below is the best that can be done unless you want to "fake" it. If you don't solution 1 it is. If not move on to solution 2.</p> <p><strong>Solution 1</strong></p> <p>You need to remove the gap between the main nav bar and the second level nav bar also removing a few things such as your float lefts and left anf right 30% and adding display inline-block fixes the width problem:</p> <p><a href="http://jsfiddle.net/j2LrQ/5/" rel="nofollow">http://jsfiddle.net/j2LrQ/5/</a></p> <pre><code> body { font: 10px normal Verdana, Arial, Helvetica, sans-serif; margin: 10px auto; padding: 0; } .container { float:left; width:100%; background:#113388; margin: 0 auto; } ul#topnav { margin: 0; padding: 0; list-style: none; font-size: 1.2em; background: #113388; position:relative; text-align:center; } ul#topnav li { display: inline-block; margin: 0; padding: 0; border-right: 1px solid #555; } ul#topnav li a { padding: 10px 15px; display: block; color: #f0f0f0; text-decoration: none; text-align:center; } ul#topnav li span { padding: 15px 0; position: absolute; left: 0; top: 100%; display: none; text-align:Center; width: 100%; background: #558ED5; color: #fff; -moz-border-radius: 0 0 5px 5px; -webkit-border-radius: 0 0 5px 5px; } ul#topnav li:hover span { display: block;} ul#topnav li span a { display: inline; } ul#topnav li span a:hover {text-decoration: underline; } </code></pre> <p><strong>Solution 2</strong></p> <p>If you created your buttons as images (this could be in photoshop or gimp or any image editing software) The button would be exactly as you have already created HOWEVER underneath the button you would double up the space with white space. This would give the ILLUSION that there is white space in between the first nav bar and the second level.</p>
    singulars
    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. VO
      singulars
      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