Materialize-cards

提供:Dev Guides
移動先:案内検索

マテリアライズ-カード

マテリアライズは、さまざまな種類のカードを表示するために、さまざまな事前定義の視覚的および動作強化を適用するためのさまざまなCSSクラスを提供します。 次の表に、使用可能なクラスとその効果を示します。

Sr.No. Class Name & Description
1

card

div要素をマテリアライズカードコンテナーとして識別します。 「外部」divで必要です。

2

card-content

divをカードコンテンツコンテナとして識別し、「内部」divで必要です。

3

card-title

divをカードタイトルコンテナとして識別し、「内部」タイトルdivで必要です。

4

card-action

divをカードアクションコンテナとして識別し、適切なテキスト特性をアクションテキストに割り当てます。 「内部」アクションdivで必須。コンテンツは、コンテナを介さずにdiv内に直接入ります。

5

card-image

divをカードイメージコンテナーとして識別し、「内部」divで必要です。

6

card-reveal

divを公開テキストコンテナとして識別します。

7

activator

divを公開されたテキストコンテナおよび画像として表示し、表示するようにします。 画像に関連するコンテキスト情報を表示するために使用されます。

8

card-panel

divを、影とパディングを持つ単純なカードとして識別します。

9

card-small

divを小さなサイズのカードとして識別します。 高さ:300px;

10

card-medium

divを中サイズのカードとして識別します。 高さ:400px;

11

card-large

divを大きなサイズのカードとして識別します。 高さ:500px;

次の例では、カードクラスを使用してさまざまな種類のカードを紹介します。

materialize_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.finddevguides.com">
                     www.finddevguides.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.finddevguides.com">
                     www.finddevguides.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.finddevguides.com">
                     www.finddevguides.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>

結果

結果を確認します。