Shopify themes, liquid, logos, and UX
Hi,
Can someone help me change the background color of my hero section to #eaeaea for mobile view only?
I don't want to change the aspect ratio to fill the white space. Additionally, changing the background color in the theme editor changes the bg-color on all pages, which I don't want either.
I need only this specific section to have this particular background color.
store link: https://www.nutravalid.com/
any help is greatly appreciated
Solved! Go to the solution
This is an accepted solution.
Go to your online store -> edit code -> theme.liquid file and paste this code in the end of file
{% if template == 'index' %}
<style>
@media only screen and (max-width: 768px) {
body {
background-color: #eaeaea !important;
}
}
</style>
{% endif %}
This is an accepted solution.
Replace the code with this
{% if template == 'index' %}
<style>
@media only screen and (max-width: 768px) {
body {
background-color: #eaeaea !important;
}
}
@media only screen and (min-width: 1024px) {
.m-button.m-button--link.m-button--large {
top: 65px !important;
}
}
</style>
{% endif %}
This is an accepted solution.
Go to your online store -> edit code -> theme.liquid file and paste this code in the end of file
{% if template == 'index' %}
<style>
@media only screen and (max-width: 768px) {
body {
background-color: #eaeaea !important;
}
}
</style>
{% endif %}
Amazing - Thank you so much..
Could you also look into the "Shop" button on desktop? If possible, could you help me move it slightly lower?
This is an accepted solution.
Replace the code with this
{% if template == 'index' %}
<style>
@media only screen and (max-width: 768px) {
body {
background-color: #eaeaea !important;
}
}
@media only screen and (min-width: 1024px) {
.m-button.m-button--link.m-button--large {
top: 65px !important;
}
}
</style>
{% endif %}
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025