reposition things in a media query - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Media

Description

reposition things in a media query

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">
#mobileImg {<!--  w ww.  j a va 2  s .  c  o m-->
   display:none;
}

@media only screen and (max-width: 768px)  {
   #desktopImg {
      display:none;
   }
   
   #mobileImg {
      display:block;
   }

}
</style> 
 </head> 
 <body> 
  <img src="https://www.java2s.com/style/demo/Firefox.png" alt="W3Schools.com" id="desktopImg"> 
  <nav> 
   <!--Menu items--> 
   <a href="">Lorem </a> 
   <a href="">Lorem </a> 
   <a href="">Lorem </a> 
   <a href="">Lorem </a> 
  </nav> 
  <img src="https://www.java2s.com/style/demo/Opera.png" alt="W3Schools.com" id="mobileImg">  
 </body>
</html>

Related Tutorials