diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css
index 4c7a7dce53630..ffe6a40b36998 100644
--- a/src/librustdoc/html/static/rustdoc.css
+++ b/src/librustdoc/html/static/rustdoc.css
@@ -558,10 +558,8 @@ a {
left: -5px;
}
.small-section-header > .anchor {
- left: -20px;
-}
-.small-section-header > .anchor:not(.field) {
left: -28px;
+ padding-right: 10px; /* avoid gap that causes hover to disappear */
}
.anchor:before {
content: '\2002\00a7\2002';
@@ -758,6 +756,7 @@ a.test-arrow:hover{
.section-header:hover a:before {
position: absolute;
left: -25px;
+ padding-right: 10px; /* avoid gap that causes hover to disappear */
content: '\2002\00a7\2002';
}