Skip to content

Ratio

The ratio helper keeps a box at a fixed aspect ratio whatever its width, which is perfect for media placeholders, thumbnails, galleries and banners. Pick ratio-1x1, ratio-4x3, ratio-16x9 or ratio-21x9, or set any ratio with the --bs-aspect-ratio variable.

1The four built-in ratios

ratio-1x1, ratio-4x3, ratio-16x9 and ratio-21x9 next to each other, filled with a plain div.

1:1
4:3
16:9
21:9

2Video placeholder

A 16:9 poster image with a centred play button, ready for a video player of your choice.

Video poster

3Square product thumbnails

ratio-1x1 with object-fit-cover gives every product the same tile, whatever the photo size.

Web development

Web development

Photography

Photography

Video editing

Video editing

Python basics

Python basics

Digital marketing

Digital marketing

Public speaking

Public speaking

4Cinematic hero banner

ratio-21x9 for a wide banner with a headline overlay.

Your next career starts here

Mentors review your projects and give feedback within two days.

5Map placeholder

A 4:3 box reserved for a map, showing the address until the map loads.

Nimbus Labs373 Harbour Road, Kyoto

6Custom 3:2 photo

Any ratio works with the --bs-aspect-ratio variable: 2 / 3 = 66.67% for classic photo prints.

A beginner's guide to getting started
3:2 · How to learn a new skill in 30 days

7Portrait team cards

A 3:4 portrait ratio (133.33%) for team photos in cards.

Sofia Varga

Sofia Varga

QA Engineer

Ruby Silva

Ruby Silva

Project Manager

Isla Tanaka

Isla Tanaka

Sales Executive

8Vertical stories

A 9:16 ratio (177.78%) for phone sized stories or short clips in a scrolling row.

Story by Freya AlvarezFreya
Story by Theo NguyenTheo
Story by Samir DelgadoSamir
Story by Kai BrennanKai

9Chart area

A 16:9 box that keeps a simple bar chart in proportion on every screen.

Monthly bookings

10Blog card cover

ratio-16x9 as a card image keeps every post card in a grid the same height.

Five things we learned this year
tips

How to choose the right course

Apr 11, 2026

11Caption over a gradient

A 4:3 image with a gradient overlay so white caption text stays readable.

DublinMentoring

12Mixed ratio gallery

Combining 1:1, 4:3 and 16:9 tiles in one responsive grid.

Gallery photo 1
Gallery photo 2
Gallery photo 3
Gallery photo 4

13Thumbnails in table cells

A small ratio-1x1 box keeps order line images square inside a table.

ImageItemPrice
Python basics
Python basics$127.00
UX fundamentals
UX fundamentals$149.00
Digital marketing
Digital marketing$119.00

14Empty cover placeholder

A dashed 4:3 area that reserves space for an image that has not been chosen yet.

No cover image yet

15Colour swatches

Empty square ratios make perfect colour swatches for a style guide.

primary

primary

secondary

secondary

success

success

info

info

warning

warning

danger

danger

16Video thumbnails with badges

Duration and status badges positioned over 16:9 thumbnails.

10:43New

Tips for learning while working full time

3:55

From teacher to UX designer: a career story

5:29

Building a portfolio that gets interviews

17Media list

Fixed width 4:3 thumbnails beside article titles in a reading list.

  • Five study habits that actually work

    Sep 28, 2025 · 8 min read

  • What our students asked us most

    Dec 4, 2025 · 7 min read

  • Headlines people actually click

    Oct 25, 2025 · 8 min read

18Responsive ratio

A small custom class changes --bs-aspect-ratio per breakpoint: square on phones, 21:9 on tablets and up.

Learn new skills at your own pace

19Round avatars

ratio-1x1 with rounded-circle keeps profile pictures perfectly round even when the source is not square.

Ivy Novak
Ivy
Kenji Harlow
Kenji
Noah Okafor
Noah
Lea Whitaker
Lea

20Loading skeleton

A 16:9 placeholder block with placeholder-glow while the real image and text load.

The skeleton reserves the exact space, so the page does not jump when content arrives.