diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index b4c7638b7984..a8c044ab69bd 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -578,7 +578,7 @@ h2.location a {
position: relative;
}
-.example-wrap > pre.example-line-numbers {
+pre.example-line-numbers {
overflow: initial;
border: 1px solid;
padding: 13px 8px;
diff --git a/src/librustdoc/html/static/css/themes/ayu.css b/src/librustdoc/html/static/css/themes/ayu.css
index 34411ace6fd3..44238ca573dc 100644
--- a/src/librustdoc/html/static/css/themes/ayu.css
+++ b/src/librustdoc/html/static/css/themes/ayu.css
@@ -190,7 +190,7 @@ pre.rust .attribute {
color: #e6e1cf;
}
-.example-wrap > pre.example-line-numbers {
+pre.example-line-numbers {
color: #5c67736e;
border: none;
}
diff --git a/src/librustdoc/html/static/css/themes/dark.css b/src/librustdoc/html/static/css/themes/dark.css
index 9978f5f91874..858d836c03d5 100644
--- a/src/librustdoc/html/static/css/themes/dark.css
+++ b/src/librustdoc/html/static/css/themes/dark.css
@@ -155,7 +155,7 @@ pre.rust .question-mark {
color: #ff9011;
}
-.example-wrap > pre.example-line-numbers {
+pre.example-line-numbers {
border-color: #4a4949;
}
diff --git a/src/librustdoc/html/static/css/themes/light.css b/src/librustdoc/html/static/css/themes/light.css
index 377aca7b3a79..6fbea6f6c7a5 100644
--- a/src/librustdoc/html/static/css/themes/light.css
+++ b/src/librustdoc/html/static/css/themes/light.css
@@ -141,7 +141,7 @@ pre.rust .question-mark {
color: #ff9011;
}
-.example-wrap > pre.example-line-numbers {
+pre.example-line-numbers {
border-color: #c7c7c7;
}