I am looking to change the font color and background color using custom CSS for just a section of the theme, specifically the collection section on the link below. I would like to have a gray background with a white font. I can figure it out the right shade of gray later.
I could not find the answer anywhere.
I use the Turbo Theme 2.0, which provides the option to add custom CSS to just a section: https://jardinfdflowers.com
Hey there, if youâre using the custom css box located on the section within the customizer, you can probably target the âdivâ itself or use the ID of the section. Try simply putting..
div {
background-color:grey;
color:white;
}
You can use â#ffffffâ hex codes for the colors as well, just replace color name with the #xxcode. If that doesnât work, try targeting the section ID with..
If that doesnât work, try targeting the ID (second box above) by placing this at the bottom of your themes css file in the theme editor instead of in the customizer. Hope that helps!
This is Richard from PageFly - Landing page builder, Iâd like to suggest this idea:
Step 1: Go to Online Store->Theme->Edit code
Step 2: Asset->/custom.css->paste below code at the bottom of the file:
Thank you for your help, I appreciate it. I used your solution and it works.
Would you please tell me if is it possible to change the shade of grey. When I mentioned I knew how to do it, I thought the solution would have the color numbers #⌠:). I donât anything about coding.
Some apps had to do some changes to their codes to work correctly on Shopify 2.0. I mentioned to them that after the changes, I lost the dark background on the homepage that you helped me with. They said that is besides their scope.
The code is still there, but it does not work. Also, a line needs to be added for when the product is sold out (the text is still black)
You can definitely change the background and font color for just one section without affecting the rest of your theme. Since Turbo 2.0 lets you add section-specific CSS, you can target the collection section directly. For example:
/* Target the collection section by its ID or class */
#CollectionSection {
background-color: #808080; /* example gray */
color: #ffffff; /* white text */
}
/* Optional: make sure headings and links inside also change */
#CollectionSection h2,
#CollectionSection p,
#CollectionSection a {
color: #ffffff;
}
Youâll just need to replace #CollectionSection with the actual ID or class of your collection section â you can find it by inspecting the page in your browser.
I also made an app, Easy Edits, that you can use to change all this stuff without touching code. You just click and change, or talk to the AI to have it edit for you.
You can achieve that effect without much coding. Essentially, you want the âbodyâ or page wrapper to have a background color, and then constrain the main content to your normal width so the edges show the cream color. For example:
body {
background-color: #f8f4e6; /* light cream */
}
.main-content-wrapper {
background-color: #ffffff; /* your normal page content */
margin: 0 auto; /* centers content */
max-width: 1200px; /* adjust to your page width */
padding: 20px; /* optional spacing */
}
This way, the desktop view has the cream on the sides, but your content stays centered. On mobile, the content fills the screen as usual, so it looks good automatically.
I also made Easy Edits â you can click and drag to set background colors, spacing, and content widths, or just ask the AI to make the change like youâre talking to a person.