Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Some of the cleanest drop down implementations I have seen are based on semantic HTML (unordered lists, <code>nav</code> element(s), etc.) and the CSS <code>:hover</code> pseudo class. Semantic structures degrade nicely when script is not available and are interpreted well when consumed by devices like screen readers.</p> <p>Older versions of IE which do not support the <code>:hover</code> pseudo class can be accommodated with a snippet of script (no jQuery required).</p> <p>Suckerfish/Son of Suckerfish is a good example of this technique.</p> <p><a href="http://www.htmldog.com/articles/suckerfish/dropdowns/" rel="nofollow">Code/Description</a><br> <a href="http://www.htmldog.com/articles/suckerfish/dropdowns/example/" rel="nofollow">Examples</a></p> <h2>Example</h2> <p>Here is the simplest implementation I could create which works in IE7+, Chrome, FF, etc. No script required.</p> <p>Complete sample: <a href="http://jsfiddle.net/BejB9/4/" rel="nofollow">http://jsfiddle.net/BejB9/4/</a></p> <p><strong>HTML</strong><br> <em>I'd wrap this in a <code>nav</code> tag in a finished document</em></p> <pre><code>&lt;ul class="nav"&gt; &lt;li&gt;This item has a dropdown &lt;ul&gt; &lt;li&gt;Sub item 1&lt;/li&gt; &lt;li&gt;Sub item 2&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;Item&lt;/li&gt; &lt;li&gt;So does this item &lt;ul&gt; &lt;li&gt;Sub item 1&lt;/li&gt; &lt;li&gt;Sub item 2&lt;/li&gt; &lt;/ul&gt; &lt;/li&gt; &lt;/ul&gt; </code></pre> <p><strong>CSS</strong></p> <pre><code>UL.nav &gt; LI { list-style: none; float: left; border: 1px solid red; position: relative; height: 24px; /* height included for IE 7 */ } UL.nav UL{ left: -10000px; position: absolute; } UL.nav &gt; LI:hover UL{ left: 0; top: 24px; /* IE7 has problems without this */ } </code></pre> <p>​</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. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. 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