mirror of
https://github.com/Chalarangelo/mini.css.git
synced 2025-01-18 05:18:25 +01:00
Modal dialog demo added
This commit is contained in:
parent
01b4f5bd83
commit
13283dd7cb
@ -20,6 +20,7 @@
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<input type="checkbox" class="modal" id="modal1"><div><label for="modal1" autocomplete="off"></label><div><label for="modal1"><span class="close"></span></label><h3>Modal dialog</h3><hr><p>This is a modal dialog.</p></div></div>
|
||||
<input type="checkbox" id="nav-toggle" autocomplete="off">
|
||||
<div class="nav fixed">
|
||||
<a href="https://chalarangelo.github.io/mini.css"><span class="logo"> <img src="favicon.png" style="height: 34px; width: auto; display: inline-block; vertical-align: middle;"> mini.css </span></a>
|
||||
@ -497,6 +498,39 @@
|
||||
<span class="bdg blue">6</span></pre>
|
||||
</div><br>
|
||||
|
||||
<h2 id="modal">Modals</h2>
|
||||
<p>Modal dialogs can be easily added and customized to the user's liking and offer support for the close button utility. <strong>Showing more than one modal dialog at once might have unexpected results and is not encouraged.</strong></p>
|
||||
|
||||
<h3>Modal dialog structure</h3>
|
||||
<p>The basic structure of a modal dialog is as follows:</p>
|
||||
<ul>
|
||||
<li>Use the <code>.modal</code> class on a <code><input type="checkbox"></code>. <strong>Place this checkbox along with any other elements specified below at the very start of your <code><body></code>.</strong></li>
|
||||
<li>Add a <code><div></code> right after the checkbox. Inside it add a second <code><div></code> with your modal dialog's contents, as well as a <code><label></code> for the checkbox <strong>without any content inside it.</strong> This label will act as the overlay behind the modal. If you do not want clicking the background to close the modal dialog, add the label without linking it to the checkbox.</li>
|
||||
<li>If you have enabled close button support, you can add a <code><span class="close"></code> inside a label for the checkbox in the innermost <code><div></code> to add a close button to the top right corner of your modal dialog.</li>
|
||||
<li>Finally, add a label lining to the modal dialog's checkbox anywhere in your page. You can also toggle the modal using Javascript, by setting the checkbox's state to <code>checked</code>.</li>
|
||||
</ul>
|
||||
|
||||
<h3>Modal dialog example</h3>
|
||||
<div class="panel" ><h4 class="head">Example</h4><br>
|
||||
<label for="modal1" class="btn red">Open modal</label><br><br>
|
||||
<pre class="panelcode"><input type="checkbox" class="modal" id="modal1">
|
||||
<div>
|
||||
<label for="modal1" autocomplete="off"></label>
|
||||
<div>
|
||||
<label for="modal1">
|
||||
<span class="close"></span>
|
||||
</label>
|
||||
<h3>Modal dialog</h3>
|
||||
<hr>
|
||||
<p>This is a modal dialog.</p>
|
||||
</div>
|
||||
</div>
|
||||
...
|
||||
<label for="modal1" class="btn red">Open modal</label></pre>
|
||||
</div><br>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user