diff --git a/src/librustdoc/html/static/css/rustdoc.css b/src/librustdoc/html/static/css/rustdoc.css
index ae9727a4d4f57..ff53566b53f3f 100644
--- a/src/librustdoc/html/static/css/rustdoc.css
+++ b/src/librustdoc/html/static/css/rustdoc.css
@@ -1687,7 +1687,12 @@ instead, we check that it's not a "finger" cursor.
padding-right: 3px;
background-color: var(--target-background-color);
border-right: 3px solid var(--target-border-color);
- animation: 0.65s cubic-bezier(0, 0, 0.1, 1.0) 0.1s targetfadein;
+}
+
+@media not (prefers-reduced-motion) {
+ :target {
+ animation: 0.65s cubic-bezier(0, 0, 0.1, 1.0) 0.1s targetfadein;
+ }
}
.code-header a.tooltip {