mirror of
https://github.com/Chalarangelo/mini.css.git
synced 2025-07-31 02:50:26 +02:00
Navigation dropdown demos
This commit is contained in:
@@ -180,6 +180,7 @@
|
||||
<li>Use an element with the <code>.logo</code> class for your website's logo.</li>
|
||||
<li>For the navigation links, use an unordered list (<code><ul></code>) and <strong>inside</strong> each <code><li></code> element, add another element with the <code>.link</code> class to stylize the element as a navigation link.</li>
|
||||
<li>Responsiveness can be added for fixed navigation bars by adding a hidden <code><input type="checkbox"></code> right before the navigation bar and a label linking to that specific checkbox right after the navigation bar.</li>
|
||||
<li>Use <code>autocomplete="off"</code> to make your menu not open by default in mobile devices.</li>
|
||||
</ul>
|
||||
|
||||
<h3>Horizontal navigation bar</h3>
|
||||
@@ -198,7 +199,7 @@
|
||||
<li><a href="#" class="link">Link 2</a></li>
|
||||
</ul>
|
||||
</div></pre>
|
||||
</div><br>
|
||||
</div>
|
||||
|
||||
<h3>Vertical navigation bar</h3>
|
||||
<div class="panel"><h4 class="head">Example</h4><br>
|
||||
@@ -218,7 +219,82 @@
|
||||
</div></pre>
|
||||
</div><br>
|
||||
|
||||
<h2 id="dropdown">Dropdowns</h2>
|
||||
<p>The dropdown module is an extra module that allows you to add dropdown components to your navigation bars. These components can be customized and work well on mobile devices. <strong>Using too many dropdowns or nesting dropdowns is yet undocumented and might cause unexpected behavior.</strong></p>
|
||||
|
||||
<h3>Dropdown structure</h3>
|
||||
<p>The basic structure of dropdowns is as follows</p>
|
||||
<ul>
|
||||
<li>To add a dropdown component, add the <code>.dropdown</code> class to one of your link elements inside the navigation bar.</li>
|
||||
<li>Add an <code><input type="checkbox"></code> with the <code>.dropdown</code> class and right after it a <code><div></code> element that contains an unordered list with list elements that contains navigation links, exactly like you would make a normal navigation menu.</li>
|
||||
<li>For multiple dropdowns, you should use <code><input type="radio"></code> elements.</li>
|
||||
<li>On mobile devices, there might be issues with the dropdown not closing after a link is clicked (mainly when it links to the same page). This can be easily dealt with using javascript (by making all the links inside the dropdown's <code><div></code> element uncheck the navigation bar's checkbox) or using <code><label></code> elements creatively inside the links.</li>
|
||||
<li>Use <code>autocomplete="off"</code> to make your dropdown not open by default in mobile devices.</li>
|
||||
</ul>
|
||||
|
||||
<h3>Horizontal navigation dropdown example</h3>
|
||||
<div class="panel"><h4 class="head">Example</h4><br>
|
||||
<div class="nav">
|
||||
<span class="logo">Logo</span>
|
||||
<ul>
|
||||
<li><a href="#" class="link">Link 1</a></li>
|
||||
<li><label class="link dropdown" for="dropdown1">Dropdown</label></li>
|
||||
</ul>
|
||||
<input type="checkbox" id="dropdown1" class="dropdown" autocomplete="off">
|
||||
<div>
|
||||
<ul>
|
||||
<li><a href="#" class="link">Link 2</a></li>
|
||||
<li><a href="#" class="link">Link 3</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><br>
|
||||
<pre class="panelcode"><div class="nav">
|
||||
<span class="logo">Logo</span>
|
||||
<ul>
|
||||
<li><a href="#" class="link">Link 1</a></li>
|
||||
<li><label class="link dropdown" for="dropdown1">Dropdown</label></li>
|
||||
</ul>
|
||||
<input type="checkbox" id="dropdown1" class="dropdown" autocomplete="off">
|
||||
<div>
|
||||
<ul>
|
||||
<li><a href="#" class="link">Link 2</a></li>
|
||||
<li><a href="#" class="link">Link 3</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div></pre>
|
||||
</div>
|
||||
|
||||
<h3>Vertical navigation dropdown example</h3>
|
||||
<div class="panel"><h4 class="head">Example</h4><br>
|
||||
<div class="nav vertical">
|
||||
<span class="logo">Logo</span>
|
||||
<ul>
|
||||
<li><a href="#" class="link">Link 1</a></li>
|
||||
<li><label class="link dropdown" for="dropdown2">Dropdown</label></li>
|
||||
</ul>
|
||||
<input type="checkbox" id="dropdown2" class="dropdown" autocomplete="off">
|
||||
<div>
|
||||
<ul>
|
||||
<li><a href="#" class="link">Link 2</a></li>
|
||||
<li><a href="#" class="link">Link 3</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div><br>
|
||||
<pre class="panelcode"><div class="nav vertical">
|
||||
<span class="logo">Logo</span>
|
||||
<ul>
|
||||
<li><a href="#" class="link">Link 1</a></li>
|
||||
<li><label class="link dropdown" for="dropdown1">Dropdown</label></li>
|
||||
</ul>
|
||||
<input type="checkbox" id="dropdown1" class="dropdown" autocomplete="off">
|
||||
<div>
|
||||
<ul>
|
||||
<li><a href="#" class="link">Link 2</a></li>
|
||||
<li><a href="#" class="link">Link 3</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div></pre>
|
||||
</div><br>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user