diff --git a/src/librustdoc/html/templates/page.html b/src/librustdoc/html/templates/page.html
index 8540ee663193..7690d8f251f7 100644
--- a/src/librustdoc/html/templates/page.html
+++ b/src/librustdoc/html/templates/page.html
@@ -23,11 +23,13 @@
{%- for theme in themes -%}
{#- -#}
{%- endfor -%}
+ {%- if !layout.default_settings.is_empty() -%}
{#- -#}
+ {%- endif -%}
{#- -#}
{%- if page.css_class.contains("crate") -%}
{#- -#}