Re: Hide The Section On Mobile CSS Code Does Not working

Solved

Hide The Section On Mobile CSS Code Does Not working

pmhkook
Excursionist
17 0 5

I have used multiple codes found online and none of them are working to hide my image banner on mobile. I have been adding them to my base.css file.
I have previously used the codes below to hide an image banner on other product pages and have worked flawlessly but this page won't work.

 

The codes I've tried:
@media screen and (max-width:749px){
#shopify-section-template--21897093513515__image_banner_df3LJy {display:none; visibility:hidden;}
}

 

@media (max-width: 768px) {

section#shopify-section-template--21897093513515__image_banner_df3LJy { display: none!important; }

}

 

Accepted Solutions (2)
PageFly-Amelia
Shopify Partner
529 157 223

This is an accepted solution.

I am not seeing the css in your source code. Maybe you can add code below before the closing </head> tag in your theme.liquid file. 

<style>
@media screen and (max-width: 768px) {
  section#shopify-section-template--21897093513515__image_banner_df3LJy {
    display: none !important;
}
}
</style>

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 
➜ Weekly updated Shopify tutorials on YouTube 


All features are available from Free plan. Live Chat Support is available 24/7.

View solution in original post

PageFly-Amelia
Shopify Partner
529 157 223

This is an accepted solution.

Awesome, I am glad to hear it! You are very welcome.

 

Yes, if you have tried base.css then theme.liquid is the next best place to put code that will be in all pages of your site. 

 

Although, I would recommend looking through your theme setting sin customize theme, because most themes do have a "custom css" section that you can also add code to avoid placing code in your theme.liquid. 

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 
➜ Weekly updated Shopify tutorials on YouTube 


All features are available from Free plan. Live Chat Support is available 24/7.

View solution in original post

Replies 10 (10)

PageFly-Amelia
Shopify Partner
529 157 223

Hello @pmhkook 

This is Amelia at PageFly - Shopify Advanced Page Builder app.

 

Could you please share the URL link of your store so we can check it for you?

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 
➜ Weekly updated Shopify tutorials on YouTube 


All features are available from Free plan. Live Chat Support is available 24/7.

pmhkook
Excursionist
17 0 5

The top image under the scrolling green bar displayed on mobile needs to be hidden 

PageFly-Amelia
Shopify Partner
529 157 223

You can try the code I have provided to help you solve the problem you are facing:

@media screen and (max-width: 768px) {
  section#shopify-section-template--21897093513515__image_banner_df3LJy {
    display: none;
}
}

 

Hoping my solution helps you solve your problem.

Best regards,

Amelia | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 
➜ Weekly updated Shopify tutorials on YouTube 


All features are available from Free plan. Live Chat Support is available 24/7.

pmhkook
Excursionist
17 0 5

It didn't work 😞

 

PageFly-Amelia
Shopify Partner
529 157 223

Are you making changes to a preview theme or the live theme? I was going to inspect the site for the changes.

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 
➜ Weekly updated Shopify tutorials on YouTube 


All features are available from Free plan. Live Chat Support is available 24/7.

pmhkook
Excursionist
17 0 5

Changes are being made to the live theme

PageFly-Amelia
Shopify Partner
529 157 223

This is an accepted solution.

I am not seeing the css in your source code. Maybe you can add code below before the closing </head> tag in your theme.liquid file. 

<style>
@media screen and (max-width: 768px) {
  section#shopify-section-template--21897093513515__image_banner_df3LJy {
    display: none !important;
}
}
</style>

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 
➜ Weekly updated Shopify tutorials on YouTube 


All features are available from Free plan. Live Chat Support is available 24/7.

pmhkook
Excursionist
17 0 5

YES!! That worked!! THANK YOU!!!

Would you recommend using that code in the theme.liquid file for other pages I am having this issue with?

PageFly-Amelia
Shopify Partner
529 157 223

This is an accepted solution.

Awesome, I am glad to hear it! You are very welcome.

 

Yes, if you have tried base.css then theme.liquid is the next best place to put code that will be in all pages of your site. 

 

Although, I would recommend looking through your theme setting sin customize theme, because most themes do have a "custom css" section that you can also add code to avoid placing code in your theme.liquid. 

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 
➜ Weekly updated Shopify tutorials on YouTube 


All features are available from Free plan. Live Chat Support is available 24/7.