{"data":{"slug":"github-thedaviddias-front-end-checklist-skills-video-thumbnail-179151df4586","title":"Add Thumbnail Images to Videos","summary":"Add a representative thumbnail image to `<video>` elements in HTML using the `poster` attribute to improve user experience and prevent layout shifts.","url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-video-thumbnail-179151df4586","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-thedaviddias-front-end-checklist-skills-video-thumbnail-179151df4586","markdown_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-video-thumbnail-179151df4586.md","download_url":"https:\/\/skillshunter.net\/skills\/github-thedaviddias-front-end-checklist-skills-video-thumbnail-179151df4586\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Ensure the poster image has the same aspect ratio as the video (typically 16:9) and a resolution of at least 1280\u00d7720px. Set `width` and `height` attributes on the `<video>` element to prevent layout shifts.","instructions":"---\nname: video-thumbnail\ndescription: \"Use when applies to all `<video>` elements in HTML. The `poster` attribute specifies the URL of an image to show as a placeholder before the video is loaded or played. This is distinct from captions or audio descriptions, which are accessibility requirements. The poster is primarily a UX and performance enhancement, though the lack of a poster can indirectly create a CLS (Cumulative Layout Shift) issue if video dimensions are not declared.\"\nmetadata:\n  category: html\n  priority: medium\n  difficulty: beginner\n  estimatedTime: \"10\"\n  source: frontendchecklist.io\n  url: https:\/\/frontendchecklist.io\/rules\/html\/video-thumbnail\n---\n\n# Add thumbnail images to videos\n\nWithout a poster image, a `<video>` element displays as a blank black rectangle until the first frame is loaded. This is visually jarring, provides no context about the video content, and can cause layout shift (CLS) if the video dimensions are not specified separately. A good thumbnail image communicates the video topic at a glance, allows users to decide whether to play, and improves the page's visual quality \u2014 especially on slow connections where video preloading is delayed.\n\n## Quick Reference\n\n- Add a `poster` attribute to `<video>` elements with a URL to a representative thumbnail image\n- The poster image displays before the video loads and while the user decides whether to play\n- Poster images improve perceived performance by showing meaningful content before video data arrives\n- The poster should accurately represent the video content \u2014 deceptive thumbnails violate user trust\n- Use an image ratio matching the video's aspect ratio (typically 16:9) and a resolution of at least 1280\u00d7720\n\n## Check\n\nFind all `<video>` elements. For each, check that: (1) a `poster` attribute is present with a non-empty URL; (2) the URL resolves to a valid image (no 404s); (3) the `width` and `height` attributes or CSS dimensions are set to prevent layout shift while the poster loads; (4) the poster image accurately represents the video content (not a clickbait or unrelated image).\n\n## Fix\n\n(1) Add a `poster` attribute to each `<video>` element: `<video poster='thumbnail.jpg' controls>`. (2) Use an image that represents the video content \u2014 typically a frame from the video, a title card, or a branded thumbnail. (3) Ensure the poster image has the same aspect ratio as the video (usually 16:9). (4) Recommended poster dimensions: 1280\u00d7720px minimum for HD video; 640\u00d7360px is acceptable for smaller embeds. (5) Host the poster image at a CDN-cached URL to ensure fast loading. (6) Also set `width` and `height` on the `<video>` element to prevent CLS.\n\n## Explain\n\nThe HTML `poster` attribute on `<video>` specifies a URL for an image to display before video playback begins. When `preload='none'` or `preload='metadata'` is set (recommended for performance \u2014 avoids downloading video data on page load), no video frame is available for display, making the poster image the only visual content visible to the user before play. Without a poster, users see either a black rectangle or a browser-rendered blank video frame, which provides no context. The poster also plays a role in perceived performance \u2014 users on slow connections see meaningful content immediately rather than waiting for even the first video frame to load.\n\n## Code Review\n\nReview templates, server-rendered HTML, and shared components that output markup related to Add thumbnail images to videos. Flag exact elements, attributes, and routes where the rendered HTML violates the rule.\n\n---\n\nFor full implementation details, code examples, and framework-specific guidance,\nsee `references\/rule.md`.\n\nRule page: https:\/\/frontendchecklist.io\/rules\/html\/video-thumbnail\n","use_cases":["Add a representative thumbnail image to a `<video>` element to display before playback begins.","Ensure the poster image accurately represents the video content to maintain user trust.","Prevent layout shifts by setting `width` and `height` attributes on the `<video>` element."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/thedaviddias\/Front-End-Checklist\/blob\/e8d14d049010e2ce25afcd5e8609dfcbbe63e47e\/skills\/video-thumbnail\/SKILL.md","source_commit":"e8d14d049010e2ce25afcd5e8609dfcbbe63e47e","license":null,"version":null,"listing_approved_at":"2026-11-24","created_at":"2026-11-23T06:08:10.000000Z","updated_at":"2026-11-24T07:12:47.000000Z","seo_title":"Add thumbnail images to videos HTML","seo_description":"Improve user experience by adding thumbnail images to videos using the `poster` attribute in HTML. Enhance perceived performance and prevent layout shifts.","seo_keywords":["HTML video poster","Add video thumbnail","Video thumbnail image","HTML poster attribute","Prevent layout shift"]}}