• Skip to primary navigation
  • Skip to main content
  • Skip to footer
Web Design KC's Logo

Web Design KC

we build really cool websites for small businesses.

  • Home
  • Pricing
    • SEO
    • Maintenance Request
  • Portfolio
    • Case Studies
  • About
    • For Agencies
    • Locations
  • Blog
  • Contact
Home » Blog » Put a Video Inside a Custom Shape with CSS

Put a Video Inside a Custom Shape with CSS

October 9, 2026 by Kolten Craft Leave a Comment

CSS Lab 03 / Video inside a shape — illustrated example

A custom shape can connect a video to the rest of a brand’s design. Our TFES work used a logo-shaped video treatment; this teaching example starts with a simpler angled shape and an original abstract clip. It uses clip-path, a useful first step before working with a detailed SVG mask.

Try the CSS03 / Video inside a shape

Change the CSS below. The preview updates as you type. Your edits stay in this browser tab.

Live preview

Press Play, then edit --cut to change the top corner. Playback is optional.

HTML for this example
<div class="video-demo"><div class="video-shape"><video controls muted playsinline preload="none" poster="https://webdesignkc.com/wp-content/plugins/wdkc-content-grids/assets/lab/shape-poster.png" aria-label="Silent abstract shapes animation"><source src="https://webdesignkc.com/wp-content/plugins/wdkc-content-grids/assets/lab/shape-motion.mp4" type="video/mp4">Your browser cannot play this video.</video></div><p>A silent, original four-second shapes clip. Use Play to watch it; the lower edge stays rectangular for its controls.</p></div>

Draw the visible area with percentages

Each pair in polygon() is an x/y point measured from the top-left corner. The browser joins those points and clips everything outside them. Change --cut to alter the top corner. The video keeps an aspect-ratio, and object-fit: cover fills its box without stretching the footage.

Keep playback controls usable

Clipping a video can also clip its controls. This polygon cuts only the top-left corner, leaving the bottom edge intact for the native player. Keep the cut modest, then check Play, Pause, seeking, and keyboard operation. There is no autoplay or audio track. A decorative background video with a more elaborate mask needs its own usable pause control outside the mask; CSS styling alone does not manage playback.

Move from an angle to a logo

For a detailed silhouette, use an authorized SVG or transparent image with mask-image, plus mask-size: contain and mask-repeat: no-repeat. Check the shape in your target browsers and retain a rectangular fallback. Keep headings and essential information outside the masked media.

The TFES website shows the original project context. Our small demo clip and polygon are separate educational assets, not its production footage or logo.

Reference: MDN on clip-path.

Have a client website that needs this kind of attention? See our WordPress development for agencies and case studies.

Keep exploring

CSS LabCSS FundamentalsVisual Design
  • TFES: A Custom Website Shaped by the Brand ↗
  • Zoom an Image Inside Its Frame on Hover with CSS ↗
  • Create Consistent Image and Video Frames with CSS aspect-ratio ↗

Browse the full blog →

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Footer

phone – (816)694-0458
email – kolten@webdesignkc.com

copyright © 2026

WebDesignKC-Logo-Teel

let’s work together on
your next project!

contact

Copyright © 2026 • WebDesignKC • Design by Web Design KC Logo