How can I change the button color while keeping text black?

Topic summary

A user needed to change the button color in Shopify’s “Image with text” component while keeping the text black, as both elements were changing color together.

Solutions Provided:

Two community members offered CSS-based fixes:

  • Option 1: Add custom CSS to the image-with-text.css file (or theme’s main CSS file) targeting .image-with-text--content .inner button with properties for white background, black text color, and a black border.

  • Option 2: Insert CSS code in the theme.liquid file before the </body> tag, targeting .image-with-text a button span for text color and .image-with-text button for background color.

Both solutions use !important flags to override existing styles. The issue was resolved successfully, with the original poster confirming the fix worked.

Summarized with AI on November 13. AI used: claude-sonnet-4-5-20250929.

How can I change color of the button on Image with text component and keep text black? Now if I change text, button changes as well.

Here is link to my page:

https://kbvg84388a10ytwi-82635784493.shopifypreview.com

1 Like

Hi @Sasha84

Do you mean like this?

I add some border so the side of the button would be visible.

If it is check this code.

From your Shopify admin dashboard, click on “Online Store” and then “Themes”.

Find the theme that you want to edit and click on “Actions” and then “Edit code”.

In the “Assets” folder, click on “Image-with-text.css or app.css” file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:

.image-with-text--content--inner .button {
    background: white !important;
    color:black !important;
    border: 1px solid black;
}

And Save.

You can edit and change the colors.

Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!

1 Like

Hello @Sasha84

You can add code by following these steps

  1. Go to Online Store → Theme → Edit code.

  2. Open your theme.liquid file

  3. Paste the below code before on theme.liquid

.image-with-text .button{ background: #fff !important; } .image-with-text a.button span { color: #000 !important; }

Hi! It works, thx a lot!

1 Like