From 71983ccd14918197551593cbbaa21e8e5f5c8d69 Mon Sep 17 00:00:00 2001 From: Rashed Hossain Date: Thu, 7 May 2026 17:47:16 +0600 Subject: [PATCH] Add aspect ratio for YouTube shorts iframe YouTube Shorts embeds are displayed with an incorrect aspect ratio on mobile devices, causing the iframe to overflow its container and break the layout. This PR adds a targeted CSS rule to ensure Shorts (vertical videos) maintain a proper 9:16 aspect ratio, allowing them to scale correctly within responsive layouts. Ticket: https://core.trac.wordpress.org/ticket/65067 --- src/wp-includes/css/wp-embed-template.css | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/wp-includes/css/wp-embed-template.css b/src/wp-includes/css/wp-embed-template.css index 6118ab4d2b6d1..c72f7358aa41f 100644 --- a/src/wp-includes/css/wp-embed-template.css +++ b/src/wp-includes/css/wp-embed-template.css @@ -314,6 +314,11 @@ p.wp-embed-share-description { cursor: text; } +.wp-block-embed__wrapper iframe[src*="youtube.com/shorts"] { + aspect-ratio: 9 / 16; + height: auto; +} + textarea.wp-embed-share-input { height: 72px; }