my ads code only appears on the desktop version?

Posted in: Newsmag
Post count: 44

hello, I added a slider banner code in the footer,

how can I do that this code only appears on the desktop and not from tablets and smatphone?

here is my code:

<!-- start expandable footer -->
<style >
#divPubblicita {
height: 30px;
width: 850px;
display: block;
z-index: 10001;
text-align: left;
/*margin-left: 10%;*/
/*margin-right: auto;*/
margin: 0 auto;
top: 0px;
/*overflow: visible;*/
position: relative;
}
#parentPubb {
height: 30px;
display: block;
position: fixed;
z-index: 10001;
text-align: left;
margin: 0px 0px 0px 0px;
width:100%;
bottom: 0px;
}
.bottApriPubb {
position: absolute;
z-index: 10002;
top: 1px;
right: 1px;
background-image: url(/moviemedia/button_expand2.png);
display: block;
width: 47px;
height: 27px;
}
.bottChiudiPubb {
position: absolute;
z-index: 10002;
top: 1px;
right: 1px;
background-image: url(/moviemedia/button_close2.png);
display: block;
width: 47px;
height: 297px;
}
</style>
<div id="parentPubb">
<div id="divPubblicita" >
<!-- dfp-->
<!-- Footer_expandable800X300 -->
<!-- /92719100/800x300a -->
<div id='div-gpt-ad-1438609368102-2' style='height:300px; width:800px;'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1438609368102-2'); });
</script>
</div>
<!-- dfp-->

thank you

Post count: 44

?

Post count: 6535

Hi

You can use media queries to hide the ads on smaller screen like here:

@media (max-width: 1021px){
.example {
display: none;
}
}

You need to target the specific classes for your ad, and also set the resolution where you want to hide the ad. Keeping the current resolution the ad will be hidden on screens smaller than 1021 px width.

If you can’t manage to do this on your own we advise you to turn to a freelancer to help you do ti as we cannot provide customization services at the moment. Sorry!
Hope this helps!

Thanks for the message!

Post count: 44

Thanks

Viewing 4 posts - 1 through 4 (of 4 total)
The forum ‘Newsmag’ is closed to new topics and replies.