From 1796afcc277c3f457904fd616c80fa903f3c74ea Mon Sep 17 00:00:00 2001 From: Joen A <1204802+jasmussen@users.noreply.github.com> Date: Wed, 20 Jan 2021 20:02:05 +0100 Subject: [PATCH] Cover: Fix matrix alignment issue. (#28361) For context, position absolute, combined with width/height 100% works in most cases, but is still subject to the box model, collapsing margins, and other hard-to-predict things. By replacing those with top/right/bottom/left values of zero, we set neither widths nor heights, but accomplish the same. --- packages/block-library/src/cover/style.scss | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/cover/style.scss b/packages/block-library/src/cover/style.scss index fc9f05941b56e..babccb49bf5c0 100644 --- a/packages/block-library/src/cover/style.scss +++ b/packages/block-library/src/cover/style.scss @@ -172,8 +172,10 @@ .wp-block-cover__image-background, .wp-block-cover__video-background { position: absolute; - width: 100%; - height: 100%; + top: 0; + right: 0; + bottom: 0; + left: 0; object-fit: cover; }