Hi everyone, I am trying to show some sections and hide some sections from on mobile vs desktop.
I tried the following CSS, and applied the appropriate tags (“only-mobile and only-desktop) to each section.
@media only screen and (min-width: 769px) {
.only-mobile { display: none !important; }}
@media only screen and (max-width: 768px) {
.only-desktop { display: none !important; }}
The end result is both items show on desktop, mobile and tablet. Any ideas?
Hey 34oldcat29,
Your tags are ID’s not classes, please try this instead:
@media only screen and (min-width: 769px) {
#only-mobile { display: none !important; }}
@media only screen and (max-width: 768px) {
#only-desktop { display: none !important; }}
Please clear any cache plugin and your browser cache.
Best regards,
Mike
Thanks Mike. I changed tags to IDs and cleared cache on three separate systems but still show both mobile and desktop sections on all devices. Do you see the same on your end?
Anything else I may be missing?
To be clear, I created a page title only for desktops with the “only-desktop” tag. I created a second page title with the “only-mobile” tag.
Hi,
Yes I’m seeing the same, yet when I add the css to my browser only one or the other will show. Can you please include a admin login in the private content area so we can take a closer look.
Best regards,
Mike
Hi,
You had a few errors in your quick css, I corrected and now your site is working. please clear your browser cache and check.
Best regards,
Mike
Ha! I see the error now!
} in the wrong place
Thank you sir
Hi,
Did you need further help, or shall we close this thread?
Best regards,
Jordan Shannon
Case closed! All working now!