css filmstrip
2022 - what a time to be alive!
i can make a container that looks like a filmstrip with a single CSS class.
either vertical - yay a demo!
.filmstrip-vertical {
background-image: linear-gradient(
to right,
transparent 20px,
black 20px,
black calc(100% - 20px),
transparent calc(100% - 20px)
),
repeating-linear-gradient(#000, #000 20px, #fff 20px, #fff 40px);
background-repeat: repeat-y;
box-sizing: border-box;
border-left: 20px solid black;
border-right: 20px solid black;
padding: 20px 40px;
}
or horizontal - another demo!
.filmstrip-horizontal {
background-image: linear-gradient(
to bottom,
transparent 20px,
black 20px,
black calc(100% - 20px),
transparent calc(100% - 20px)
),
repeating-linear-gradient(90deg, #000, #000 20px, #fff 20px, #fff 40px);
box-sizing: border-box;
border-top: 20px solid black;
border-bottom: 20px solid black;
padding: 40px 20px;
}
i needed this today.
you may need it tomorrow.
enjoy CSS.
CSS is freedom.
CSS is life.