Created
July 27, 2022 19:41
-
-
Save potat-dev/2825b14a12c295e9d29eac0107259b23 to your computer and use it in GitHub Desktop.
Modal that closes when clicked outside, goes bottom on mobile screen and goes middle on desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- The button to open modal --> | |
<label for="my-modal" class="btn modal-button">open modal</label> | |
<input type="checkbox" id="my-modal" class="modal-toggle" /> | |
<label for="my-modal" class="modal modal-bottom sm:modal-middle"> | |
<label class="modal-box"> | |
<h3 class="font-bold text-lg">Congratulations random Internet user!</h3> | |
<p class="py-4">You've been selected for a chance to get one year of subscription to use Wikipedia for free!</p> | |
<div class="modal-action"> | |
<label for="my-modal" class="btn">Yay!</label> | |
</div> | |
</label> | |
</label> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment