diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index 1ae3b0b88c6dd..ad5bc021408c0 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -282,7 +282,7 @@ nav.sub {
padding-left: 0;
}
-body:not(.source) .example-wrap {
+:not(.source) .example-wrap {
display: inline-flex;
}
@@ -299,7 +299,7 @@ body:not(.source) .example-wrap {
text-align: right;
}
-body:not(.source) .example-wrap > pre.rust {
+:not(.source) .example-wrap > pre.rust {
width: 100%;
}