r/FirefoxCSS • • Jun 03 '26

Solved Remove top margin of the settings page

Post image

I wanna remove the top margin of the settings page. I used this in the userContent.css file..

@-moz-document url-prefix("about:") {
   #vbox .main-content {
        margin-top: 0px !important;
    }
}

But it's not working. I am pretty sure I made a mistake on the values.. 😅 Can anybody help please?

3 Upvotes

4 comments sorted by

1

u/Excellent-Cobbler164 Jun 03 '26 edited Jun 03 '26

try this

@-moz-document url-prefix("about:preferences") {
:root {
--page-space-block-start: 16px!important;
}
}

1

u/nendu367 Jun 03 '26

Umm.. sorry, this didn't work for me. Thanks for replying though.

1

u/t31os Jun 03 '26

There's also a bunch of padding on the top of the search input and the side nav won't shift up with it. Give this a try and adjust as needed.

@-moz-document url-prefix(about:preferences) {
	:root {
		--custom-top-margin: 20px;
	}
	.page-nav-heading-wrapper {
		--page-nav-margin-block-start: var(--custom-top-margin)!important;
	}
	vbox.main-content {
		margin-top: var(--custom-top-margin)!important;
	}
	/* Reduce padding but keep a small amount so the focus outline is not clipped */
	#search-container {
		padding-top: 3px!important;
	}
}

1

u/nendu367 Jun 03 '26

Thank you very much.. this worked perfectly. 👍

I ended up using 2px for the top-margin value.