How can I change the font color on mobile view?

Topic summary

A user needs to change font color in an “image with text overlay section” from white to black, but only on mobile view while keeping desktop white.

Solutions provided:

  • Add CSS media query targeting mobile screens (max-width: 767px) to theme.liquid file before the </body> tag
  • Target specific classes: h1.overlay-text__title and .overlay-text__rte.rte.large-text p
  • Set color to black with !important flag
  • Alternative approach: add CSS to theme.scss.liquid or styles.scss.liquid file in the Assets folder

Resolution:

The initial solution worked for most pages, but homepage had persistent white text issues with smaller font sizes. The user ultimately resolved this by deselecting the “enlarge font” option for the image with text overlay section on their homepage, which allowed the CSS changes to take effect properly.

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

Hello,

I am looking for some help with changing the color for the “image with text overlay section.”

I had changed the header to white for the desktop view, but I wanted to change the mobile view to black so It is visible. I have attached some screenshots to help explain what I am talking about.

The link to the website page is.

https://clairamor.com/pages/halo-engagement-rings

Any help is greatly appreciated!

Thank you,

Cameron

@diamors

Please add the below code above in theme.liquid

online store >> edit code >> theme.liquid

@media screen and (max-width: 767px) { h1.overlay-text__title { color: #000!important; } .overlay-text__rte.rte.large-text p { color: #000!important; } }

after added looks like that

if our solution helpful for you then please like the post and tap on accepted.

if you discuss further information related with shopify you can contact us

Thankyou :slightly_smiling_face:

1 Like

Hi @diamors ,

I understand that you want to change the color for the “image with text overlay section.”

  1. From your Shopify admin dashboard, click on “Online Store” and then “Themes”.
  2. Find the theme that you want to edit and click on “Actions” and then “Edit code”.
  3. In the “Assets” folder, click on “theme.scss.liquid” or “styles.scss.liquid” file, depending on which file your theme uses to store its CSS styles.
  4. At the bottom of the file, add the following CSS code:
  5. And Save.
@media only screen and(max-width: 767px) {
.overlay-text__rte.rte.large-text p {
    color: black;
}
h1.overlay-text__title {
    color: black !important;
}
}

Hello,

Thank you for the reply! This worked for the majority of my pages. For my homepage, there was an issue with the smaller text still having the white font on mobile. Is it my Custom CSS thats causing an issue? Here is the link to the page

https://clairamor.com/

Hi @diamors ,

Its possible because of the costum css..

Here are some css style to change into balck text.

@media only screen and(max-width: 767.98px){
.overlay-text__rte.rte p {
    color: black;
}
}

Result.

I hope it help.

I fixed the problem of the text not changing on my homepage. It was because I had deselected “enlarge font” for the image with text overlay section.