PRACTICAL WEB TIP
Film Contact Sheet
A contact-sheet border and frame number appear around a portfolio photograph.
Live Demo
Hover over the element or use Tab to focus.
Source Code
Copy the HTML, CSS or JavaScript you need for your project.
HTML
<a class="tbx-1113" href="#photos" aria-label="View photo project"><span class="tbx-1113__photo" aria-hidden="true"><i class="tbx-1113__sun"></i><i class="tbx-1113__hill"></i><i class="tbx-1113__hill2"></i></span><span class="tbx-1113__film" aria-hidden="true"><span>● ● ● ● ● ● ● ●</span><span>● ● ● ● ● ● ● ●</span></span><span class="tbx-1113__caption">FRAME 026 <b>↗</b></span></a>
CSS
.tbx-1113{display:block;position:relative;width:min(287px,100%);height:185px;overflow:hidden;border-radius:4px;background:#202935;color:#fff;text-decoration:none;font-family:system-ui,sans-serif;padding:8px;isolation:isolate}
.tbx-1113__photo{position:absolute;inset:8px;background:linear-gradient(175deg,#81c6c5 0%,#567e92 65%,#2f4b63 65%);transition:inset .45s,filter .45s;overflow:hidden}.tbx-1113__sun{position:absolute;top:23px;left:57%;width:45px;height:45px;border-radius:50%;background:#f8dea2}.tbx-1113__hill{position:absolute;bottom:-38px;left:-14%;width:85%;height:100px;transform:rotate(-15deg);background:#466b73}.tbx-1113__hill2{position:absolute;bottom:-49px;right:-13%;width:78%;height:119px;transform:rotate(19deg);background:#284c60}
.tbx-1113__film{position:absolute;inset:2px 5px;display:flex;justify-content:space-between;flex-direction:column;color:#f2ecdb;line-height:1;font-size:12px;letter-spacing:.1em;opacity:0;transition:opacity .36s;pointer-events:none}.tbx-1113__caption{position:absolute;bottom:9px;left:9px;right:9px;display:flex;justify-content:space-between;background:#172731dd;padding:9px 12px;letter-spacing:.12em;font-size:10px;font-weight:750;transform:translateY(120%);transition:transform .42s}.tbx-1113__caption b{font-size:15px;font-weight:400}
.tbx-1113:is(:hover,:focus-visible) .tbx-1113__photo{inset:20px 8px;filter:saturate(1.15)}.tbx-1113:is(:hover,:focus-visible) .tbx-1113__film{opacity:1}.tbx-1113:is(:hover,:focus-visible) .tbx-1113__caption{transform:translateY(0)}
.tbx-1113:focus-visible{outline:3px solid #e2c59a;outline-offset:4px}@media(prefers-reduced-motion:reduce){.tbx-1113 *{transition:none!important}}
How to Use
Insert the HTML and add the CSS to your stylesheet. Adjust colors and sizes and avoid class conflicts.
Use Case
Useful for photography portfolios and image galleries.
Technical Notes
Keep controls usable on touch devices. Test keyboard focus and reduced-motion preferences.
Mobile:Ensure the interactive content remains accessible without hover on touch devices.
Browser:Uses modern CSS. Check behavior in the browsers you support.
Reduced Motion:Check that prefers-reduced-motion is respected.