How can I effectively hide a section on a desktop view?

Jacobdss
Shopify Partner
5 0 1

Hey, I want to hide this section on desktop. I already tried CSS codes but none of them work and I don't know why, because when I tried same code on different section..it worked. The section that I want to hide is the huge ,,image with overlay section".. thank you for help

It's on the shower head product page (it's the comparison table), theme: focal, pass: dewchi

link: https://shower-head-storetest.myshopify.com/products/nashover-shower-head

Snímek obrazovky (2020).png

Replies 9 (9)

Toorbia
Shopify Partner
142 18 33

example:

In the section look for the image you want to hide. and place a custom class.

 

Toorbia_0-1701363424025.png

This is the section of the first image

 

-Now an example of CSS code passes you

 

<div class="yourClass">
<img class="desktop-visible" src="https://lumiere-a.akamaihd.net/v1/images/image_3e2d946c.jpeg?region=0,0,640,480">
</div>

 

@media only screen and (min-width: 400px) {
.desktop-visible { display:none;}
}

 

 

 

- If I solved your question, click Accept as a solution
-for custom solutions contact me by mail | henrijeair@gmail.com
Jacobdss
Shopify Partner
5 0 1

Where should I put the code? There is html, so I can't put it into theme.css

Made4uo-Ribe
Shopify Partner
5991 1444 1783

Hi @Jacobdss 

Check this one. 

  • 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 "base.css, style.css or theme.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:

 

@media only screen and (min-width: 749px){
div#shopify-section-template--16993351172348__a71ff6a9-698e-4189-aa20-c68c983b3d13 {
    display: none !important;
}
}

 

  • And Save. 
  • Result:
  • Made4uoRibe_0-1701363821868.png
  • Made4uoRibe_1-1701363842296.png

     

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

Please don't forget to 

Like

 and 

Mark Solution 

to the post that helped you. Thanks!
Sip, savor, and support – your

Coffee Tip

 helps us keep coding magic.❤️❤️❤️
For FREE, premium codes, and trusted, knowledgeable Shopify developers, visit us at

Made4uo.com


Jacobdss
Shopify Partner
5 0 1

Doesn't work for me..

 

Made4uo-Ribe
Shopify Partner
5991 1444 1783

It the app right? its better to contact the app provider. 

Please don't forget to 

Like

 and 

Mark Solution 

to the post that helped you. Thanks!
Sip, savor, and support – your

Coffee Tip

 helps us keep coding magic.❤️❤️❤️
For FREE, premium codes, and trusted, knowledgeable Shopify developers, visit us at

Made4uo.com


Jacobdss
Shopify Partner
5 0 1

It's not app, I made the comparison in canva and inserted the picture into text with overlay section and I just want to hide the text with overlay section on desktop. 

Jacobdss
Shopify Partner
5 0 1

some other solution could be just reducing the size of it only on computer, any ideas of code for that?

 

Made4uo-Ribe
Shopify Partner
5991 1444 1783

Did you try to hide in the customize theme? If its a section. Try this one again.

 

@media only screen and (min-width: 749px){
.image-overlay {
    display: none !important;
}
}

 

And Save. 

 

 

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

Please don't forget to 

Like

 and 

Mark Solution 

to the post that helped you. Thanks!
Sip, savor, and support – your

Coffee Tip

 helps us keep coding magic.❤️❤️❤️
For FREE, premium codes, and trusted, knowledgeable Shopify developers, visit us at

Made4uo.com


PageFly-Oliver
Astronaut
878 190 171

Hi @Jacobdss ,

 

You can try this code by following these steps:

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file theme.liquid

Step 3: Paste the below code at the bottom of the file -> Save

 

 

<style>
// you need get the class to use it
@media(min-width:767px){
.classElement{
display:none !important
}
}
</style>

 

Hope my solution works perfectly for you!

Best regards,

Oliver | PageFly

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


PageFly - #1 Page Builder for Shopify merchants.


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