Using @media to hide div - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Media

Description

Using @media to hide div

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
.mobile-hide {<!--from   w  w  w.java 2 s  .  c om-->
   width:100%;
   height:100px;
   background:red;
}

@media only screen and (max-width: 400px)  {
   #tiled-map {
      visibility:hidden;
      display:none;
   }
   
   .mobile-hide {
      width:100%;
      height:100px;
      background:red;
      visibility:hidden !important;
      display:none !important;
   }

}
</style> 
 </head> 
 <body> 
  <div class="container"> 
   <div class="row"> 
    <div class="col-lg-6 col-md-6"> 
     <div id="map-wrapper" class="mobile-hide" style="width: 200%; height: 600px; position: relative;"> 
      <div id="base-map"></div> 
      <div id="overlay-map"></div> 
      <div id="tiled-map"></div> 
     </div> 
    </div> 
   </div> 
  </div>  
 </body>
</html>

Related Tutorials