Hide sections on mobile/ desktop view
Custom class to hide a section on different devices
Last updated
Custom class to hide a section on different devices
Last updated
If you want to hide a specific section on mobile view and show it on desktop view or vice versa, follow the steps below.
From your Shopify admin, go to Online Store > Customize.
In the theme editor, select the section you want to customize.
Find Custom attributes in the section settings and add the following custom classes:
Display that section on desktop and hide it on mobile:
hidden md:block
Display that section on mobile and hide it on desktop:
block md:hidden
Display that section on desktop and hide it on mobile:
m:hidden md:m:block
Display that section on mobile and hide it on desktop:
m:block md:m:hidden
4. Save the settings.