Skip to content

Polaroid Photo Gallery

Pure CSS polaroid gallery on a cork board: tilted photo frames with tape and handwritten captions that straighten and lift on hover or focus.

Also known as: polaroid photo grid, scattered photo gallery, instant photo frames, cork board photo gallery

Polaroid Photo Gallery live demo

Open in new tab

Pure CSS code (HTML, CSS)

A scattered polaroid photo gallery built with pure CSS. Six square photos sit in white instant-film frames with handwritten captions and strips of washi tape, pinned at random-looking angles on a cork board. Hovering or focusing a photo straightens it, lifts it and brings it to the front. It works well for travel blogs, portfolio "about" pages, wedding sites and event recaps.

How it works

The root section.pl-board draws the cork texture with two speckled radial-gradient layers and an inset frame shadow. The photos live in a ul.pl-grid that uses two columns on phones and three from 720px. Every li.pl-item holds a figure.pl-photo with an img.pl-img and a figcaption.pl-caption.

The scattered look comes from two custom properties. Each .pl-item sets --pl-rotate and --pl-shift through :nth-child(6n + …) rules, so the pattern repeats cleanly if you add more photos, and no inline styles are needed. .pl-photo combines them in transform: translateY(var(--pl-shift)) rotate(var(--pl-rotate)). On :hover and :focus-visible the transform changes to rotate(0deg) scale(var(--pl-lift)), a deeper shadow is applied and z-index lifts the photo above its neighbours. A ::before pseudo-element draws the tape; even items get a blue strip with a different angle. No JavaScript is used.

The captions use the Caveat font from Google Fonts with a cursive fallback, and the square crop comes from aspect-ratio: 1 / 1 and object-fit: cover.

Customization

  • --pl-tilt on .pl-board: the base angle all rotations are multiplied from; 2deg gives a tidy board, 7deg a messy one.
  • --pl-lift: the zoom factor on hover, e.g. 1.15 for a stronger pop.
  • --pl-speed: duration of the straighten animation.
  • --pl-board-bg and the box-shadow on .pl-board: switch the cork for a dark slate or a plain wall color.
  • --pl-frame: the frame color; a warm #f5efe0 looks like aged film.
  • --pl-tape: color of the tape strips on odd items; edit the .pl-item:nth-child(even) .pl-photo::before rule for the even ones.
  • --pl-font: the caption font; remove the Google Fonts link if you prefer the system cursive fallback.
  • grid-template-columns in .pl-grid: show four columns on wide screens for larger collections.

Use cases

  • Travel blogs: trip photos look like pinned snapshots with handwritten captions and tape
  • Wedding and event sites: tilted frames recap the day, and each photo straightens on hover
  • Portfolio about pages: a personal, playful photo collage that adds character to a bio
  • Event recaps: square photos with captions come together on a cork board look

Accessibility

The gallery is a real list, and each figure has a figcaption, so screen readers announce the caption with the photo. Every image has a descriptive alt, width, height, loading="lazy" and decoding="async". Frames have tabindex="0" so keyboard users get the same straightened view as mouse users, with a visible blue outline from --pl-focus. With prefers-reduced-motion: reduce the transition and the scaling are removed; the photo simply straightens. The dark caption ink on the white frame keeps strong contrast.

Usage notes

The photos come from Unsplash and should be replaced with your own images. Keep them square or let object-fit crop them. If the frames should open a larger view, wrap the image in a link and move tabindex off the figure.

Polaroid Photo Gallery at a glance

Framework
Pure CSS
Code
HTML, CSS
JavaScript
Not needed, CSS only
Dependencies
fonts.googleapis.com
Layout
Responsive, works on mobile
Category
Galleries
License
Free for personal and commercial use

Questions about this template

Can I use the Polaroid Photo Gallery code for free?

Yes. You can copy or download the code and use it in personal and commercial projects, including client work. No sign-up is needed. Reselling it as part of a component library or template collection is not allowed; see the license.

How do I add it to my website?

Load fonts.googleapis.com from a CDN (the links are under Requirements). Paste the HTML where the component should appear and add the CSS to your stylesheet. Download HTML gives you a complete page with everything already linked.

Does it need jQuery or a JavaScript framework?

No. It is built with HTML and CSS only, so there is no JavaScript to load.

Does it work on mobile?

Yes. The layout adapts to small screens. Use the Mobile and Tablet buttons above the live demo to check it at phone and tablet width.

Requirements

Add these to your page (already included in the download):

  • <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Caveat:wght@500;700&display=swap">
Polaroid Photo Gallery – Pure CSS galleries component screenshot
Polaroid Photo Gallery · Pure CSS Galleries

More Galleries

CSS Grid Bento Photo Gallery – Pure CSS galleries preview

CSS Grid Bento Photo Gallery

Bento-style photo gallery with mixed tile sizes from CSS Grid spans, hover captions and a keyboard-friendly dialog lightbox.

Masonry Image Gallery – Pure CSS galleries preview

Masonry Image Gallery

Pure CSS masonry image gallery using multi-column layout, with hover and focus captions that slide up over each photo. No JavaScript needed.

Before and After Image Slider for Shopify – Shopify galleries preview

Before and After Image Slider for Shopify

Drag-to-compare before and after image slider for Shopify with vertical or horizontal divider, touch and keyboard control, and optional side text.

Filterable Portfolio Gallery – Bootstrap 5 galleries preview

Filterable Portfolio Gallery

Dark Bootstrap 5 portfolio gallery with pill filter buttons, automatic category counts, fade-in tiles and a screen reader status message.

Gallery with Lightbox – Tailwind CSS galleries preview

Gallery with Lightbox

Tailwind CSS mosaic image gallery that opens an accessible lightbox with captions, arrow-key and swipe navigation, focus trap and preloading.