CSS3 Transitions in Media Queries - HTML CSS CSS Layout

HTML CSS examples for CSS Layout:Responsive Media

Description

CSS3 Transitions in Media Queries

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">
body {<!--  w w w .  j av  a  2 s.c  o  m-->
   background:white;
   -webkit-transition:background .6s;
}

.slider {
   margin:2em;
   width:221px;
   height:31px;
   background:salmon;
}

#navcontainer .slider:hover {
   width:39px;
}

#navcontainer .slider {
   -webkit-transition:width 2s;
}

@media (max-width: 440px)  {
   body {
      background:salmon;
   }
   
   .slider {
      background:white;
   }
   
   #navcontainer .slider:hover {
      width:57px;
   }

}
</style> 
 </head> 
 <body> 
  <div id="navcontainer"> 
   <div class="slider"></div> 
   <div class="slider"></div> 
   <div class="slider"></div> 
   <div class="slider"></div> 
   <div class="slider"></div> 
  </div> 
  <script type="text/javascript">

      </script>  
 </body>
</html>

Related Tutorials