diff --git a/src/librustdoc/html/static/css/settings.css b/src/librustdoc/html/static/css/settings.css
index 91419093147d7..3fa478751737f 100644
--- a/src/librustdoc/html/static/css/settings.css
+++ b/src/librustdoc/html/static/css/settings.css
@@ -33,10 +33,6 @@
padding-bottom: 1px;
}
-.radio-line .setting-name {
- width: 100%;
-}
-
.radio-line .choice {
margin-top: 0.1em;
margin-bottom: 0.1em;
diff --git a/src/librustdoc/html/static/js/settings.js b/src/librustdoc/html/static/js/settings.js
index 9ed8f63610ff6..84df1b7d3911a 100644
--- a/src/librustdoc/html/static/js/settings.js
+++ b/src/librustdoc/html/static/js/settings.js
@@ -135,7 +135,7 @@
// This is a select setting.
output += `\
-
${setting_name}
+
${setting_name}
`;
onEach(setting["options"], option => {
const checked = option === setting["default"] ? " checked" : "";
diff --git a/tests/rustdoc-gui/settings.goml b/tests/rustdoc-gui/settings.goml
index f236dc3e0fe76..72de41e41bae1 100644
--- a/tests/rustdoc-gui/settings.goml
+++ b/tests/rustdoc-gui/settings.goml
@@ -105,6 +105,33 @@ assert-css: (
"box-shadow": "rgb(33, 150, 243) 0px 0px 1px 1px",
},
)
+// Now we check the setting-name for radio buttons is on a different line than the label.
+compare-elements-position-near: (
+ "#theme .setting-name",
+ "#theme .choices",
+ {"x": 1}
+)
+compare-elements-position-near-false: (
+ "#theme .setting-name",
+ "#theme .choices",
+ {"y": 1}
+)
+// Now we check that the label positions are all on the same line.
+compare-elements-position-near: (
+ "#theme .choices #theme-light",
+ "#theme .choices #theme-dark",
+ {"y": 1}
+)
+compare-elements-position-near: (
+ "#theme .choices #theme-dark",
+ "#theme .choices #theme-ayu",
+ {"y": 1}
+)
+compare-elements-position-near: (
+ "#theme .choices #theme-ayu",
+ "#theme .choices #theme-system-preference",
+ {"y": 1}
+)
// First we check the "default" display for toggles.
assert-css: (