Different Header Color

Different Header Color

AlokBeheria
Tourist
3 0 1

Hello All,

 

I am new to Shopify and have recently created my store. However, I am encountering an issue where the header background color appears white when viewed on a desktop and black when viewed on a mobile device. I attempted to resolve this by applying the following code to Assets --> base.css, but the problem persists.

 

@media only screen and (max-width: 989px){
.header-wrapper.color-background-1.gradient {
background: white;
}
.header-wrapper.color-background-1.gradient * {
color: white;
}
div#shopify-section-sections--21453125976343__header {
margin-bottom: 0px;
}
}

 

Desktop Header

desktop_header.png

 

 

Mobile Header

mobile_header.jpeg

 

Regards

 

 

 

Replies 4 (4)
AlokBeheria
Tourist
3 0 1

I applied your solution, but issue still persist. 

Regards

shipiyfy_answer.png

Sangeetanahar
Excursionist
409 25 53

Hello @AlokBeheria 

you replace your code to this code

.header-wrapper.color-background-1.gradient {
  background: white;
}


@media only screen and (max-width: 989px) {
  .header-wrapper.color-background-1.gradient {
    background: white; 
  }
  .header-wrapper.color-background-1.gradient * {
    color: black; 
  }
  div#shopify-section-sections--21453125976343__header {
    margin-bottom: 0px;
  }
}

Buy me a Pizza
- If helpful then please Like and Accept Solution.

Thanks

Was I helpful?

Buy me a coffee



Want to modify or custom changes or bug fix on store . Or Need help with your store? Or -Want Complete Storefront
Email me -sangeetarahuldhiman@gmail.com - Skype: live:sangeetarahuldhiman -Whatsapp: +917009811712
Checkout Some Free Sections Here
AlokBeheria
Tourist
3 0 1

After applying and save it , it refused to work.

 

Regards

A

devcoders
Shopify Partner
227 40 55

Hi @AlokBeheria 

Here’s a more structured approach:

 

Define the CSS for desktop and mobile separately.
Ensure selectors are correctly targeting the elements.
Check for other conflicting styles.

 

Here’s an improved version of your CSS code:

 

- Go to Online Store -> Theme -> Edit code.
- Find the file assets/base.css and paste the code below at the bottom of the file.

 

 

.header-wrapper.color-background-1.gradient {
  background: white;
}
.header-wrapper.color-background-1.gradient * {
  color: black; /* Assuming you want text color to be black on desktop */
}

@media only screen and (max-width: 989px) {
  .header-wrapper.color-background-1.gradient {
    background: black;
  }
  .header-wrapper.color-background-1.gradient * {
    color: white;
  }
  div#shopify-section-sections--21453125976343__header {
    margin-bottom: 0px;
  }
}

 

Shopify Developer: Helping eCommerce Stores
If you need assistance with your store, feel free to contact us at devcodersp@gmail.com.
If my assistance was helpful, please consider liking and accepting the solution. Thank you!