How can I change the background color of a full-width section?

I’ve added an image-and-text section to my store’s product pages. I’d like to change the background color, using CSS, so that the section’s background color spans the full width of the window.

I have a custom CSS asset, and it’s working fine. I just haven’t had any luck identifying the CSS that will govern the section’s background. Thoughts?

This screenshot shows the section I’m working on, highlighted in blue.

Try to add in your CSS file

#MainContent div:nth-of-type(1) {background-color: black;}

or

#MainContent div:nth-of-type(1) {background-color: black!important;}

Hi @digialkrouse

Do you mind sharing your website so we can provide a specific code for you?

Here’s what I wound up with, based on @vmstukalov 's suggestion (thank you):

#shopify-section-template--15585985921164__1663072908e403e984 div:nth-of-type(1) {background-color: #e3e3e3;}

This code doesn’t cover the full width of the window, but it’s good enough for my purposes. (Screenshot below)