Materialize Tutorial on Materialize Media

materialize has several classes to make images and videos responsive to different sizes.

  • responsive-img − it makes an image to resize itself based on the screen size.

  • video-container − for responsive container having embedded videos.

  • responsive-video − makes html5 videos responsive.

example

<!doctype html>
<html>
   <head>
      <title>the materialize example</title>
         <meta name="viewport" content="width=device-width, initial-scale=1">
         <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=material+icons">
         <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/css/materialize.min.css">
         <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
         <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.3/js/materialize.min.js"></script>
   </head>
   <body class="container">
      <h2>materialize media examples</h2>
      <hr/>
      <h3>images demo</h3>
      <div class="card-panel">
         <img src="html5-mini-logo.jpg" alt="" class="responsive-img">
      </div>
      <div class="card-panel">
         <img src="html5-mini-logo.jpg" alt="" class="circle responsive-img">
      </div>
      <h3>responsive embeded video demo</h3>
      <div class="video-container"> 
         <iframe width="540" height="200" src="http://www.youtube.com/embed/q8txgczxenw?rel=0" frameborder="0" allowfullscreen></iframe>
      </div>
      <div class="video-container">
         <video width="300" height="200" controls autoplay>
            <source src="http://www.tutorialspoint.com/html5/foo.ogg" type="video/ogg" />
            <source src="http://www.tutorialspoint.com/html5/foo.mp4" type="video/mp4" />
            your browser does not support the video element.
         </video>
      </div>
   </body>
</html>

output

verify the output.

materialize utilities materialize utilities