Archived topic
Hide Element from mobile
10 replies · Started by Francesco on December 21, 2021
Hi guys,
I created specific sidebars using Elements.
Everything works perfectly, but I cannot hide the sidebars in the mobile version of the site.
I have searched the forum but have found nothing about it.
What I'm doing wrong?
Many thanks in advance.
Francesco
Hi there,
you will require CSS to hide them.
If you can link me to the site, so i can see the layout then i can advise the best way to do that
Hi David,
Many thanks in advance.
OK so it looks like the Sidebar is made up of content within GB Container Blocks.
Edit those Container Blocks - in Advacnced > Additional CSS Class(es) add: hide-on-mobile
more info here on the GP built in hide-on-* classes:
https://docs.generatepress.com/article/responsive-display/#using-our-hide-on-classes
NOTE If you're a GenerateBlocks Pro user, then in Advanced there are built in toggles to hide on mobile etc.
Hi David,
many thanks for your answer. Where should I add the CSS Class: https://www.dropbox.com/s/dpntcpr7qrxr6wm/Schermata%202021-12-21%20alle%2014.51.08.png?dl=0
Hi,
Got similar question about a hero image: it looks great on desktop but I want to hide it on mobile so people don't have to scroll. How could I do this?
-- EDIT --
Oops sorry, easy as this!
https://docs.generatepress.com/article/responsive-display/#using-our-hide-on-classes
Thanks :-)
Franck
In the settings sidebar select Blocco there you will see a panel named Advanced, within there is the field for the Additional CSS Classes.
I'm sorry David, but I can't find what you're talking about:
https://www.dropbox.com/s/uq95hlsfzvq0zq0/Schermata%202021-12-21%20alle%2016.04.09.png?dl=0
In your image you have the Shortcode block selected. You need to have the Container Block selected.
Oh my God... Got it.
Sorry for disturbing you with this silliness.
Thanks.
No problems - glad to be of help!