CSS Tip #25 – CSS-Only Modal #shorts

Subscribe to @NetNinja
Visit for more tips & tricks!
Full courses:


Just wanted to share with you an easy Way to make a mold like this using only CSS it's dead simple so in the HTML we Have a div with an idea modal and some Modal content inside that we have an Anchor tag which targets that model Using its ID and it's this thing that Helps us to style it when it's open in The CSS we have basic styles for the Modal and the modal content now to hide And show it we use the visibility Property and we set it to Hidden by Default so we don't see it but then we Use the target sudo selector to say make This visible when it is the target Element and that happens when we click On the anchor tag in the HTML and in the Browser we can see this open when we Click on the anchor because the modal is Now the Target and we can see that up Here it closes when we click on this one Because we're then setting a different Target

You May Also Like

Leave a Reply

Your email address will not be published. Required fields are marked *