-1

I am using this code in my websites as a banner widget it works fine but I want that it should not be shown on a mobile device, only visible to the desktop screen. So please help me in adding media query so that it will hide form mobile devices.

<script type='text/javascript'>
$(document).ready(function() {$(&#39;img#closed&#39;).click(function(){$(&#39;#bl_banner&#39;).hide(90);});});
</script>
<div id='fixedbox' style='width:100%;margin:auto;text-align:center;float:none;overflow:hidden;display:scroll;position:fixed;bottom:0;z-index:999;-webkit-transform:translateZ(0);'>
<div><a id='close-fixedbox' onclick='document.getElementById(&apos;fixedbox&apos;).style.display = &apos;none&apos;;' style='cursor:pointer;'><img alt='close' src='http://1.bp.blogspot.com/-_A83iDM6JYc/VhtxROLILrI/AAAAAAAADK4/aM4ikIA6aqI/s1600/btn_close.gif' title='close button' style='vertical-align:middle;'/></a></div>

<div style='text-align:center;display:block;max-width:790px;height:120px;overflow:hidden;border-bottom:2px #005094 solid;
border-top:30px #005094 solid;
border-right:2px #005094 solid;
border-left:2px #005094 solid;margin-left:auto;margin-right:auto;'>
</div>
</div>
ASHISH KUMAR
  • 155
  • 1
  • 10

1 Answers1

0

If you want to use media queries, you shouldn't use inline styling. It is better to use a separate CSS file for working with styles. However, if it is not possible for some reason, you can add your styles and media queries to the <style scoped>...</style> tag. Check how it is done here: Is it possible to put CSS @media rules inline?

jphawk
  • 70
  • 2
  • 2
  • 11