I would be interested to know if you can make a modal pop-up window just using HTML and CSS without JQuery.
Does anyone know such a simple example?
Thanks in advance!
I would be interested to know if you can make a modal pop-up window just using HTML and CSS without JQuery.
Does anyone know such a simple example?
Thanks in advance!
Yes, it is possible.
You can use the
:target
pseudo selector to show a modal. Here's an example including some transitions as well (code combined from shehary's codepen example and http://tympanus.net/Development/ModalWindowEffects):If you don't feel comfortable using
visibility: hidden
you can usedisplay: none
instead. But you better remove the transitions in that case (visibility
can be used in a transition,display
can't).A modal with only HTML and CSS no jQuery or javascript