Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Drop down menus can suck, especially making them work with touch screen devices since you can't 'hover' on a touchscreen. This is how I do my drop down menus, it is pure CSS, and I have tested it on chrome, ff, ie7+, safari, iPhone and multiple Android (of course, you will want to tweak colors and sizing):</p> <p>HTML</p> <pre><code>&lt;div id="navigation"&gt; &lt;ul id="nav"&gt; &lt;li&gt;&lt;a href="index.html&gt;Home&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Drop Down&lt;/a&gt; &lt;!--Notice didn't close the li yet-&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="link"&gt;Drop Down Item&lt;/a&gt;&lt;/li&gt; &lt;li...../li&gt; etc... &lt;/ul&gt; &lt;/li&gt; &lt;li&gt;&lt;a href="#"&gt;Another Drop Down&lt;/a&gt;&lt;/li&gt; &lt;ul&gt; ... &lt;/ul &lt;/li&gt; &lt;/ul&gt; &lt;/div&gt; </code></pre> <p>CSS:</p> <pre><code>#nav { display: block; text-align: center; font-size: 1em; position: relative; height: 3em; width: 950px; margin-right: auto; margin-left: auto; list-style-type: none; } #nav li { float: left; display: block; width: 75px; height: 3em; position: relative; } #nav li a { text-decoration: none; display: block; height: 1em; padding-top: 1em; padding-bottom: 1em; } #nav li a:hover { color: #990000; background-color: #999999; } #nav li ul { width: 100%; display: none; z-index: 9999; position: absolute; } #nav li ul li { display: block; clear: both; width: 100%; height: 100%; background-color: #B5BDC8; } #nav li:hover ul { display: block; } </code></pre> <p>The idea behind all of this is to create a list, then inside that other lists to create the drop down elements....</p> <p>Then, from there, display only the primary list items to begin with, then show the drop down menu on hover (or in the case of a mobile device on click by making the main list item a link to "#" thus creating and active/hover state)...</p> <p>The only issue is that by using display:none it isn't screen reader friendly, however I always include site navigation at the bottom that is screen reader friendly, and SEO friendly as well.</p> <p>You can see an example of this in action on this website I am working on <a href="http://patrickjc.com/neon" rel="nofollow">here</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.
    1. This table or related slice is empty.
    1. VO
      singulars
      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