Click on "Choose a map"
Hi everyone,
I have a normal "Choose a map" button. I wanna make it so that when clicking on it - two pictures pops out and you can then press on one of them.
Right now im only use HTML and CSS. I wanna keep is a simple as possible.
I dont need a tutorial, just a little guidance on where to look π
5 Replies
If you want to keep it without JS, you can use a checkbox and use the
:checked
pseudo-class to show/hide your popup.
A better solution, in my eyes, would be to use JS on the button to show/hide a dialog element.
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dialogHey @daswolle
I dont mind JS, Im just not as strong in it.
And is it possible to insert pictures in the dialog element?
Only one way to find out ^.^
(Ok, more like three)
Heres Kevins video about
<dialog>
:
https://www.youtube.com/watch?v=TAB_v6yBXIEKevin Powell
YouTube
dialog = the easiest way to make a popup modal
Ever needed to make a modal? Well, we have a native HTML element that does the job with the dialog element! It does a lot of things out of the box that are really awesome, so letβs see how it works!
π Links
β
Codepen: https://codepen.io/kevinpowell/pen/KKyOYvM
β
The polyfill: https://github.com/GoogleChrome/dialog-polyfill
β
a11y modal: htt...
thanks Wolle π I will have a look that it π