Open CSS Modal via :target

CSS Modal

This modal is open because its id is the target in the href of the link. You can style an element's target state with the selector :target. When this modal is toggled, an invisible link with href="#" is positioned absolutely behind the modal content. Clicking it will change the target and thus close the modal.