How to change blog post section as well as page section from white background color to black?

Topic summary

A user needed help changing the background color from white to black in their Shopify store’s blog post and page sections, after successfully updating other areas.

Problem identified:

  • Background remained white in specific sections despite store-wide color changes
  • Affected pages: blog posts and standard pages

Solution provided:

  • Add CSS code to base.css file (Shopify Admin → Online Store → Theme → Edit code)
  • First code snippet: main#MainContent{background: #000;} changed background to black
  • Second code snippet: h1, h2, h3, h4, h5, .h0, .h1, .h2, .h3, .h4, .h5, p, span{color: #fff !important;} changed text color to white

Resolution:
Issue fully resolved. The user successfully implemented both CSS modifications to achieve black backgrounds with white text across all sections.

Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

Hey Community,

I changed my background color in my stire to black. It worked on most pages/section but not in the blog post section and the “normal” page section. The pics show where its still white.

Could someone assist me with that?

Thanks a lot,

Bianca

@BBajmel i think these pages have white background for sections, can you please share this page link?

Hey there,

thanks for your reply.

here are the links:

https://www.bajberlin.com/blogs/mental-sustainability-blog

https://www.bajberlin.com/pages/thisisbaj

@BBajmel please add this css to the very end of your base.css file and check,
Shopify Admin → Online Store ->Theme → Edit code → base.css

main#MainContent{background: #000;}

Thanks a lot @suyash1 . now the background is black but the writing is still black to and disappeared. whats the code to change the color of text into white?

@BBajmel - try this

h1, h2, h3, h4, h5, .h0, .h1, .h2, .h3, .h4, .h5, p, span{color: #fff !important;}

awesome, that worked!!! thank you so much! that was great help.