HTML poster Attribute

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 3 Examples
Media & Video

Introduction

The poster attribute sets a thumbnail image on the <video> element. Browsers show this image before the user presses play and while the first video frame is loading. It gives visitors a visual preview of the content — like a movie poster or YouTube thumbnail. The value is a URL to an image file (JPEG, PNG, WebP). Once playback starts, the poster is replaced by video frames. Use video.poster in JavaScript to swap thumbnails dynamically. Pair with preload and controls for a polished media experience.

What You’ll Learn

01

Thumbnail

Before play.

02

<video>

Only element.

03

Image URL

JPEG, PNG.

04

.poster

JS property.

05

vs preload

Different role.

06

UX boost

Preview cue.

Purpose of poster Attribute

Without a poster, a video may show a blank or black rectangle until the user interacts or the first frame loads. The poster attribute solves this by displaying a chosen still image — a marketing thumbnail, title card, or representative frame from the clip.

This improves first impressions on landing pages, course platforms, and product demos. A good poster tells users what the video is about before they commit to loading and playing it.

💡
Poster is not the video file

poster points to a separate image URL. The actual video still comes from <source src="…"> or the src attribute on video.

📝 Syntax

Add poster with an image URL on a video element:

poster.html
<video controls width="320"
  poster="/images/apple.png">
  <source src="/video/count.mp4" type="video/mp4">
  Your browser does not support the video tag.
</video>

Syntax Rules

  • Value is a URL string pointing to an image (relative or absolute).
  • Valid only on <video> — not on audio or other elements.
  • Shown until playback begins; hidden once video frames render.
  • Works with controls, preload, autoplay, and muted.
  • JavaScript: video.poster = "/images/new-thumb.jpg".
  • Empty poster="" removes the custom thumbnail.
  • Optimize image size — posters load before the video, so keep files reasonably small.

💎 Values

The poster attribute accepts a URL to an image file:

  • poster="/images/video-thumb.jpg" — Relative path on your site.
  • poster="https://example.com/preview.png" — Absolute URL.
  • poster="/images/apple.png" — PNG thumbnail.
  • poster="" — No custom poster (browser default appearance).
poster-examples.html
<!-- Relative path -->
<video poster="/images/apple.png" controls></video>

<!-- Absolute URL -->
<video poster="https://cdn.example.com/intro.webp" controls></video>

⚡ Quick Reference

ConceptBehaviorElement
posterThumbnail before playvideo only
video.posterJS read/write URLHTMLVideoElement
During playbackPoster hiddenVideo frames shown
With preload="none"Poster especially usefulVideo not pre-fetched
Image formatsJPEG, PNG, WebP, GIFStandard web images
Not supported onaudio, iframeVideo only

Applicable Elements

ElementSupported?Notes
<video>YesPrimary and only HTML element for poster
<audio>NoNo visual thumbnail — use surrounding UI
<img>NoImages use src, not poster
<iframe>NoEmbedded players handle their own thumbnails
<input>NoUse placeholder for text hints

poster vs preload vs first frame

FeatureWhat it doesWhen it matters
posterCustom thumbnail image URLBefore user presses play
preloadHints how much video to bufferPage load / bandwidth
First video frameDefault if no poster setMay be black until metadata loads
placeholder (input)Text hint in form fieldsUnrelated — different element

Examples Gallery

Basic video poster, dynamic video.poster in JavaScript, and comparing video with and without a poster.

👀 Live Preview

Before you press play, the poster image is visible:

Press play — the poster disappears and video frames take over.

Example — Basic video poster

Set a thumbnail image on a video with controls:

video-poster.html
<video controls width="320"
  poster="/images/apple.png">
  <source src="/video/count.mp4" type="video/mp4">
  Your browser does not support the video tag.
</video>
Try It Yourself

How It Works

The browser loads and displays /images/apple.png as the video area background until playback starts. The MP4 file loads separately via <source>.

Dynamic Values with JavaScript

Swap the poster image when the user clicks a button:

dynamic-poster.html
<video id="myVideo" controls width="320"
  poster="/images/apple-80.png">
  <source src="/video/count.mp4" type="video/mp4">
</video>
<button type="button" id="swapBtn">Change poster</button>

<script>
  document.getElementById("swapBtn").addEventListener("click", function () {
    document.getElementById("myVideo").poster = "/images/apple-120.png";
  });
</script>
Try It Yourself

How It Works

The poster IDL property mirrors the attribute. Changing it updates the thumbnail immediately (when the video is not playing).

Example — With poster vs without

See how a poster improves the idle appearance of a video:

poster-compare.html
<!-- With poster -->
<video controls width="240" poster="/images/apple.png">
  <source src="/video/count.mp4" type="video/mp4">
</video>

<!-- Without poster (may show blank/black) -->
<video controls width="240" preload="none">
  <source src="/video/count.mp4" type="video/mp4">
</video>
Try It Yourself

How It Works

With preload="none" and no poster, the video area often looks empty. A poster gives users a clear preview and encourages them to press play.

♿ Accessibility

  • Poster is decorative preview — It is not read as the video’s accessible name. Provide context with a visible heading or aria-label on the video when needed.
  • Meaningful nearby text — Describe what the video covers in prose next to the player, not only in the poster image.
  • Captions and transcripts — Use <track kind="captions"> for spoken content; poster does not replace captions.
  • Contrast on custom play buttons — If you hide native controls, ensure overlay buttons meet contrast requirements.
  • Don’t rely on poster text alone — Text baked into images is not accessible to screen readers.

🧠 How poster Works

1

Page loads

Video element.

Idle
2

Poster shown

Image URL.

Thumb
3

User plays

Frames render.

Play
=

Better preview

Engaging UX.

Browser Support

The poster attribute on video is supported in all modern browsers with HTML5 video.

HTML5 Video · Fully supported

Universal poster support

Video thumbnails work wherever native HTML5 video is supported.

99% Browser support
Google Chrome Fully supported
Full support
Mozilla Firefox Fully supported
Full support
Apple Safari Fully supported
Full support
Microsoft Edge Fully supported
Full support
Internet Explorer IE 9+ supported
Full support
Opera Fully supported
Full support
poster attribute 99% supported

Bottom line: Safe for video thumbnails in all modern browsers.

💡 Best Practices

✅ Do

  • Choose a poster that accurately represents the video content
  • Optimize poster file size for faster page loads
  • Match poster aspect ratio to the video dimensions
  • Use poster with preload="none" to save bandwidth
  • Test across browsers and mobile devices

❌ Don’t

  • Use misleading thumbnails that don’t match the video
  • Put essential instructions only inside the poster image
  • Apply poster to audio elements
  • Upload huge uncompressed images as posters
  • Assume poster text is accessible to screen readers

Conclusion

The poster attribute is a simple way to show a custom thumbnail on video elements before playback begins.

Pick a representative image, keep it optimized, and combine with proper labels and captions for an accessible, professional media experience.

Key Takeaways

Knowledge Unlocked

Five truths every developer should know about poster

Bookmark these before embedding videos.

5
Core concepts
🖼️ 02

Image URL

Thumbnail.

Value
▶️ 03

Before play

Idle state.

Timing
04

.poster

JS swap.

API
🔄 05

Not preload

Different job.

Compare

❓ Frequently Asked Questions

It specifies a URL to an image displayed on the video element before playback starts or while the first frame loads. It acts as a custom thumbnail.
Only <video>. The audio element does not support poster.
poster is a visible thumbnail image. preload hints how much video data to fetch before play. They complement each other.
Any standard web image format the browser can display: JPEG, PNG, WebP, or GIF.
videoElement.poster = "/path/to/image.jpg" on the HTMLVideoElement.
Yes in all modern browsers that support HTML5 video (IE 9+).

Add video thumbnails

Practice the poster attribute with basic thumbnails, JavaScript swaps, and with-vs-without comparisons in the Try It editor.

Try poster demo →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful