Gallery Responsive + Image Modal

In this example, we use CSS to create a modalx (dialog box) that is hidden by default.

We use JavaScript to trigger the modalx and to display the current image inside the modalx when it is clicked on. Also note that we use the value from the image's "alt" attribute as an image caption text inside the modalx.


×