Solved

Hide display of Sitelock badge on mobile devices

Posted on 2016-10-17
9
42 Views
Last Modified: 2016-10-18
Currently I have Sitelock badge code in the footer which I put online using Genesis Simple Edits.

We want to setup a media query so that the Sitelock badge does NOT display on mobile devices (but does on desktops) because it gets in way of viewing site content. But, I am not sure how to cite this badge in the css.  

http://sheboyganseniorcommunity.com
http://screencast.com/t/CJTXe0zMc4
0
Comment
Question by:nsitedesigns
  • 5
  • 4
9 Comments
 
LVL 20

Assisted Solution

by:Russ Suter
Russ Suter earned 500 total points
ID: 41847213
Name the containing div then just cite that div by name in your CSS.
0
 

Author Comment

by:nsitedesigns
ID: 41847235
I added it to the media query as below:
  
 .footer-widgets-1, .footer-widgets-2, .footer-widgets-3, .footer-widgets-4 {
		width: 100%;
    text-align: left;
    padding: 40px 0;
	}


div.sitelock {
    visibility: hidden;
} 

}

Open in new window


.... and I added a class to the code in the footer but it still displays.  What did I do wrong?
 
<div class="sitelock" style="position: fixed; z-index: 1000; width: 164px; height: 98px; bottom: 15px; right: 15px;"><a href="#" onclick="window.open('https://www.sitelock.com/verify.php?site=sheboyganseniorcommunity.com','SiteLock','width=600,height=600,left=160,top=170');" ><img class="img-responsive" alt="SiteLock" title="SiteLock" src="//shield.sitelock.com/shield/sheboyganseniorcommunity.com" /></a></div>

Open in new window

0
 
LVL 20

Assisted Solution

by:Russ Suter
Russ Suter earned 500 total points
ID: 41847264
it looks right to me. However my inspector doesn't show the CSS is loaded anywhere.

I'd also make 2 changes.

1. Reference the div by Id rather than class since this is a one-off thing.
2. Set display: none rather than visibility: hidden

Injecting the css with StyleBot works for me.
0
 

Author Comment

by:nsitedesigns
ID: 41847330
I emptied cache.  Still seeing badge on mobile devices.

I have the css in the plugin called simple custom css.

@media only screen and (max-width: 768px) {
  
 .footer-widgets-1, .footer-widgets-2, .footer-widgets-3, .footer-widgets-4 {
		width: 100%;
    text-align: left;
    padding: 40px 0;
	}


div.sitelock {
   display: none
} 

}

Open in new window


Here is footer code.
<div id ="sitelock" style="position: fixed; z-index: 1000; width: 164px; height: 98px; bottom: 15px; right: 15px;"><a href="#" onclick="window.open('https://www.sitelock.com/verify.php?site=sheboyganseniorcommunity.com','SiteLock','width=600,height=600,left=160,top=170');" ><img class="img-responsive" alt="SiteLock" title="SiteLock" src="//shield.sitelock.com/shield/sheboyganseniorcommunity.com" /></a></div>

Open in new window

0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 

Author Comment

by:nsitedesigns
ID: 41847335
I don't know what you mean by, "injecting the css with StyleBot"
0
 
LVL 20

Accepted Solution

by:
Russ Suter earned 500 total points
ID: 41847354
I don't see that CSS referenced anywhere but even if it was it wouldn't work as you have it right now. To reference an element by id you would need to use div#sitelock. Right now you're using div.sitelock which will reference an element by class, not Id.
0
 

Author Comment

by:nsitedesigns
ID: 41847358
I changed how it appears in simple custom css
@media only screen and (max-width: 768px)  {
div#sitelock {
   display: none
} 

}

Open in new window



I am not sure why you are not seeing the code in this plugin.  Still not working.  : (
0
 
LVL 20

Expert Comment

by:Russ Suter
ID: 41847385
I'm still seeing nothing wrong with the CSS you posted here. I just don't see the reference to the CSS file on your website and the Inspector shows no evidence of the style existing.
0
 

Author Comment

by:nsitedesigns
ID: 41849173
Today it appears to be working fine.  Thanks for the help!
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now