Using css to hide widget on website only
-
i was wondering if i could hide a widget on my main website while keeping it visible on my mobile site.
What i want is for my mobile site to have a footer with a transparent background of my social media icons. As of now, this widget is already made- i put it in my left footer section…although i can’t even see it on my site now. Again i only want this widget to show up on my mobile site NOT the main site.
The blog I need help with is: (visible only to logged in users)
-
Hello there,
That’s definitely possible! However, I’m not seeing the icons in your footer at all? Would you mind making sure those are placed in? Once I see them I can give you a media query code that will hide them for desktop.
Thanks,
Sage -
-
Ill move it to my sidebar. Then..
1. Tell me how to hide it from only full main site.
2. I already have codes in my css hiding the other widgets that show on my main site from the mobile site… How do i keep these the same while showing this new widget on mobile site? -
Hello!
Thanks for placing it in the sidebar. This code should do the trick:
#text-24 { display: none; } @media screen and (max-width: 768px) { #text-24 { display: block !important; } }It shouldn’t conflict with with any of the other CSS that changes the state of the other widgets.
Let me know if that doesn’t work,
Sage -
-
Hey there,
I’m seeing the block hidden on the desktop but probably not showing on mobile as the main sidebar doesn’t show. Would you mind moving it to your footer area and letting me know if it works there?
Thanks,
Sage -
-
-
Hi Tyler,
The following, in your custom CSS, is currently hiding all widgets on your mobile theme:
.widget-area { display: none; }To display your widgets, firstly remove the above snippet.
Next, you can hide the two widgets you don’t want to display on the mobile theme:
#text-20, #text-23 { display: none; }The above will leave the widget that you do want to display (#text-24).
Hope that helps!
-
-
Apologies for that, Tyler! Can you try the following instead?
.widget-area #text-20, .widget-area #text-23 { display: none; } -
Ok so i moved around a few things and now the social media icons show on the mobile. Thing is…..
I want text 24 only on mobile
I want text 20 and 23 only on main site
-
-
Also when i do the css to hide text 24 from main site it looks like it hid it from mobile site too… How can i fox this
-
Hi Tyler,
Try the following snippet to hide the widget on desktop but display it on mobile:
#text-24 { display: none; } .widget-area #text-24 { display: block; } -
Great! Finally..
1. How do i make tgw background of the text 24 transparent
2. How do i make the text 24 closer to the body? Decrease padsing?
-
1. How do i make tgw background of the text 24 transparent
You would apply the same rule as before – background: rgba(255,255,255,0.8); – to the .widget-area #text-24 selector. You’ll also need to set a background of none to the containing .widget-area:
.widget-area { background: none; } .widget-area #text-24 { background: rgba(255,255,255,0.8); }2. How do i make the text 24 closer to the body? Decrease padsing?
You could remove all padding between the widget and the body with the following:
#secondary { margin-top: 0; padding-top: 0; border-top: 0; } #page { margin-bottom: 0; } -
That looks like is works but there is a line underneath the icons now- how do i get ride of that?
-
Hi Tyler,
There’s a box-shadow being added beneath the icons, which you can remove with the following:
.widget-area { -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; }
- The topic ‘Using css to hide widget on website only’ is closed to new replies.