Solved

Hide display of Sitelock badge on mobile devices

Posted on 2016-10-17
9
31 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…
The purpose of this video is to demonstrate how to set up an RSS Feed on a WordPress Website. This will be demonstrated using a Windows 8 PC. Feedburner will be used for this demonstration. Go to your WordPress login page. This will look like the…

744 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

13 Experts available now in Live!

Get 1:1 Help Now