Solved

Hide display of Sitelock badge on mobile devices

Posted on 2016-10-17
9
46 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 

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
 

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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

733 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