Make a class media gallery
Arrange a photo, a GIF and a short video in a responsive CSS grid.
What you’ll learn
Create a gallery with useful photo descriptions, captions and player controls.
Before you start
Open the gallery example. The media files are included, so you can run it after offline preparation.
Steps
- Open
index.html. Change one<figcaption>and describe the image in itsaltattribute. - In
style.css, findgrid-template-columns. The15remvalue is the preferred minimum card width. Try18remand compare how many cards fit. - Press Run. Check whether the GIF moves and the video plays and seeks. Export a ZIP to keep the page and media together.
Expected result
The gallery fits the available width and each file loads from the local project.
Common mistakes
If an image is blank, compare its src with the exact name in the media folder. Use controls on the video so the reader can start it.