Materialize - Cards

Materialize provides different CSS classes to apply various predefined visual and behavioral enhancements to display various types of cards. Following table mentions the available classes and their effects.
card
Identifies div element as a Materialize card container. Required on "outer" div.
card-content
Identifies div as a card content container and is required on "inner" div.
card-title
Identifies div as a card title container and is required on "inner" title div.
card-action
Identifies div as a card actions container and assigns appropriate text characteristics to actions text. Required on "inner" actions div; content goes directly inside the div with no intervening containers.
card-image
Identifies div as a card image container and is required on "inner" div.
card-reveal
Identifies div as a revealed text container.
activator
Identifies div as a revealed text container and image to be revealer. Used to show contextual information related to image.
card-panel
Identifies div as a simple card with shadows and padding.
card-small
Identifies div as a small sized card. Height − 300px;
card-medium
Identifies div as a medium sized card. Height − 400px;
card-larger
Identifies div as a large sized card. Height − 500px;
The following example showcases the use of card classes to showcase various types of cards.
<!DOCTYPE html>
<html>
   <head>
      <title>The Materialize Cards 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">
      <div class="row">
         <div class="col s12 m6">
            <div class="card blue-grey lighten-4">
               <div class="card-content">
                  <span class="card-title"><h3>Learn HTML5</h3></span>
                  <p>HTML5 is the next major revision of the HTML standard superseding HTML 4.01, XHTML 1.0, and XHTML 1.1. HTML5 is a standard for structuring and presenting content on the World Wide Web.</p>
               </div>
               <div class="card-action">
                  <button class="btn waves-effect waves-light blue-grey"><i class="material-icons">share</i></button>
                  <a class="right blue-grey-text" href="http://www.tutorialspoint.com">www.tutorialspoint.com</a>
               </div>
            </div>
         </div>
               <div class="col s12 m6">
            <div class="card blue-grey lighten-4">
               <div class="card-image">
                  <img src="html5-mini-logo.jpg">
               </div>
               <div class="card-content">
                  <p>HTML5 is the next major revision of the HTML standard superseding HTML 4.01, XHTML 1.0, and XHTML 1.1. HTML5 is a standard for structuring and presenting content on the World Wide Web.</p>
               </div>
               <div class="card-action">
                  <button class="btn waves-effect waves-light blue-grey"><i class="material-icons">share</i></button>
                  <a class="right blue-grey-text" href="http://www.tutorialspoint.com">www.tutorialspoint.com</a>
               </div>
            </div>
         </div>
      </div>
      <div class="row">
         <div class="col s12 m6">
         <div class="card blue-grey lighten-4">
            <div class="card-image waves-effect waves-block waves-light">
               <img class="activator" src="html5-mini-logo.jpg">
            </div>
            <div class="card-content activator">
               <p>Click the image to reveal more information.</p>
            </div>
            <div class="card-reveal">
               <span class="card-title grey-text text-darken-4">HTML5<i class="material-icons right">close</i></span>
               <p>HTML5 is the next major revision of the HTML standard superseding HTML 4.01, XHTML 1.0, and XHTML 1.1. HTML5 is a standard for structuring and presenting content on the World Wide Web.</p>
            </div>
            <div class="card-action">
               <button class="btn waves-effect waves-light blue-grey"><i class="material-icons">share</i></button>
               <a class="right blue-grey-text" href="http://www.tutorialspoint.com">www.tutorialspoint.com</a>
            </div>
         </div>
      </div>
   </div>
   <div class="row">
      <div class="col s12 m3">
         <div class="card-panel teal">
            <span class="white-text">Simple Card</span>
         </div>
      </div>
      <div class="col s12 m3">
         <div class="card small teal">
            <span class="white-text">Small Card</span>
         </div>
      </div>
         <div class="col s12 m3">
            <div class="card medium teal">
               <span class="white-text">Medium Card</span>
            </div>
         </div>
         <div class="col s12 m3">
            <div class="card large teal">
               <span class="white-text">Large Card</span>
            </div>
         </div>
      </div>
   </body>
</html>
Verify the output.
 Print
 Add Notes
 Bookmark this page