What's your biggest current challenge? Have your say in Community Polls along the right column.

Re: Craft Theme

Solved

How to make a section visible on mobile but invisible on desktop?

ambientcandle19
Excursionist
50 0 4

Hey, can anyone give me the other half of this code?

I'm trying to be out of your hair. 

I have half the code that let me make a section invisible on desktop. But I don't have the other half to make it invisible on mobile. This in the code.

We were using google chrome then inspect

 

@media only screen and (max-width: 768px) {shopify-section-template--16879055372467__image_with_text_j8eNUK {display:none;}}
@media only screen and (min-width: 768px) {#shopify-section-template--16879055372467__image_with_text_AUwBFP {display: none;}}

 

what could the code for the opposite be to make the other images invisible to desktop and visible to mobile

 

 

Accepted Solutions (2)

deepaksharma
Shopify Partner
449 63 99

This is an accepted solution.

The first line hides an element when the screen is 768 pixels wide or less(hides on mobile)

 

while the second line hides a different element when the screen is wider than 768 pixels.(opposite)

Deepak Sharma || Shopify Developer || Helping eCommerce Stores
- Was my reply helpful? Accept it as solution
- Was your question answered? Mark it as an Accepted Solution.
-CHAT ON WHATSAPP | BUY ME A COFFEE | MAIL ME: ds2305187@gmail.com

View solution in original post

made4Uo
Shopify Partner
3856 717 1200

This is an accepted solution.

Hi @ambientcandle19 

 

You can easily achieve this by editing the section. We created a video that can help you set up your section to hide and show on mobile or desktop. See video below

 

 

 

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free

View solution in original post

Replies 6 (6)

deepaksharma
Shopify Partner
449 63 99

This is an accepted solution.

The first line hides an element when the screen is 768 pixels wide or less(hides on mobile)

 

while the second line hides a different element when the screen is wider than 768 pixels.(opposite)

Deepak Sharma || Shopify Developer || Helping eCommerce Stores
- Was my reply helpful? Accept it as solution
- Was your question answered? Mark it as an Accepted Solution.
-CHAT ON WHATSAPP | BUY ME A COFFEE | MAIL ME: ds2305187@gmail.com
ambientcandle19
Excursionist
50 0 4

Do you have a moment because it doesn't hide it on mobile only desktop. MAYBE the mobile is bigger than 768 pixels. I'm looking for a certain look. What if I change the 768 to 1000 or something and try again. 

 

The code only works one way on desktop. On mobile 1 see 4. 2 for each image with text section. 

And also I want it flush all the way to the sides. I want it to interfere with the boundaries of the image on mobile and completely take up the space no white border around it only on mobile

deepaksharma
Shopify Partner
449 63 99

can you provide me your store url and password if any.

and give the screenshot so i can help you with that

Deepak Sharma || Shopify Developer || Helping eCommerce Stores
- Was my reply helpful? Accept it as solution
- Was your question answered? Mark it as an Accepted Solution.
-CHAT ON WHATSAPP | BUY ME A COFFEE | MAIL ME: ds2305187@gmail.com
ambientcandle19
Excursionist
50 0 4

Screenshot_2024-03-07-15-33-06-40_40deb401b9ffe8e1df2f1cc5ba480b12.jpg

IMG_20240307_153338.jpg

  

lastcandles.myshopify.com no pw. 

 

See how it takes up the whole phone no white space and if you scroll down you see it it like overrides it 

ambientcandle19
Excursionist
50 0 4

I had to password protect the page. this is the password  "peawhi" because I have it chaotic so you can see. thanks

made4Uo
Shopify Partner
3856 717 1200

This is an accepted solution.

Hi @ambientcandle19 

 

You can easily achieve this by editing the section. We created a video that can help you set up your section to hide and show on mobile or desktop. See video below

 

 

 

If this fixed your issue Likes and Accept as Solution is highly appreciated. Coffee tips fuels my dedication.
Get EXPERIENCED Shopify developers at affordable rates—visit Made4Uo.com for quick quote!
Do not lost your Shopify store! Get FREE trial with ✔️ Rewind Backup: Automatic, reliable, stress-free