Fit portrait video without cropping

Updated: November 24, 2026

If a portrait video loses the top of someone’s head or its captions inside a landscape box, set object-fit: contain on your video element. The browser displays the whole picture and leaves spare space at the sides. This lets you keep a uniform card size and preserve the recorded composition.

Decide what needs to stay visible

Find a frame with information near its edges. For example, fit a 1080 × 1920 phone tutorial into a 640 × 360 card. Its picture occupies about 203 pixels of width at 360 pixels high. Check whether people can still read the tutorial. If the text matters, offer a larger portrait view as well.

Set up the player you control

Add the portrait-card class to the container around your video element. Set the box width and aspect ratio with the rule below. The example uses a 16:9 box, preserves the picture and gives the spare area a dark background. If your layout can accommodate different shapes instead, let the height follow each file’s natural aspect ratio.

Measure the actual card and repeat the test at your site’s narrowest breakpoint. A card that shrinks to 320 pixels wide also halves the size of the picture. If it becomes hard to read, provide a visible control to open a larger view and test it with a keyboard.

.portrait-card video { width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #151515; display: block; }

Check both orientations

Test the same card with a portrait clip and a landscape clip. Narrow the window to phone width, open the controls and look for a moment with content near the edges. If bars are visible when you open the source file by itself, they are part of the recording and this page rule will leave them in place. Check that the background and the next item on the page are easy to see.

Frequently asked questions

You can size the iframe on your page. Its player has its own document and your page styles do not change the picture inside it.

You might also like

Host your videos for free and earn from every view

Create your account in under a minute, upload your first video and start earning from day one.