Saturday, October 25, 2025
HomeLanguagesJavascriptJavascript MDBootstrap Cards Component

Javascript MDBootstrap Cards Component

MDBootstrap is a Material Design and bootstrap-based Javascript UI library that is used to make attractive webpages with its seamless and easy-to-use component. It is free for both personal & commercial use. In this article, we will know how to use Cards Component in Javascript MDBootstap.

A Cards Component is a flexible and extensible content container. It includes options for headers and footers, a wide variety of content, contextual background colors, and powerful display options.  It replaces the use of panels, wells, and thumbnails. All of it can be used in a single container called a card.

Syntax:

<div class="card">
    <img src="link"/>
     <divclass="card-body">
          <h5 class="card-title">Card title</h5>
          <p class="card-text">Text</p>
         <button class="btn">Button</button>
  </div>
</div>

Approach:

  • Download Javascript MDBootstrap from the official site.
  • Extract the files to the current working directory.
  • In the Index.html file, specify the downloaded file path in the <head> tag.

<link rel=”icon” href=”img/mdb-favicon.ico” type=”image/x-icon” />
<link rel=”stylesheet” href=”https://use.fontawesome.com/releases/v5.15.2/css/all.css” />
<link rel=”stylesheet” href=”https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700;900&display=swap”/>
<link rel=”stylesheet” href=”css/mdb.min.css” />
<script type=”text/javascript” src=”js/mdb.min.js”></script>
<script type=”text/javascript”></script>

Example 1: This is the basic example that shows how to use the cards component in MDBootstrap Javascript.

HTML




<!DOCTYPE html >
<html lang="en">
  
<head>
    <title>Javascript MDBootstrap List Group Component</title>
    <meta charset="UTF-8" />
    <meta name="viewport" 
          content="width=device-width, 
                   initial-scale=1
                   shrink-to-fit=no" />
    <link rel="icon" 
          href="img/mdb-favicon.ico" 
          type="image/x-icon" />
    <link rel="stylesheet" 
          href=
    <link rel="stylesheet" 
          href=
    <link rel="stylesheet" 
          href="css/mdb.min.css" />
    <script type="text/javascript" 
            src="js/mdb.min.js">
    </script>
</head>
  
<body>
    <div style="margin-left: 50px;">
        <h2 style="margin-top: 50px;">
            neveropen
        </h2>
        <h4>
            MDBootstrap Javascript Cards Component
        </h4>
        <br>
        <div class="card" 
             style="width: 600px"
          <img style="width: 200px;
                      height: 200px;" 
               src=
            <div style="width: 500px" 
                 class="card-body">
                <h5 class="card-title">Card title</h5>
                <p class="card-text">
                    MDBootstrap is a Material Design
                    and bootstrap-based Javascript UI
                    library that is used to make good 
                    looking webpages with its seamless 
                    and easy-to-use component.
                </p>
  
                <button class="btn btn-warning">Button</button>
            </div>
        </div>
    </div>
</body>
</html>


Output:

Javascript MDBootstrap Cards Component

Javascript MDBootstrap Cards Component

Example 2: In this example, we will know how to add a header and footer in a Card Component in MDBootstrap Javascript.

HTML




<!DOCTYPE html >
<html lang="en">
  
<head>
    <title>Javascript MDBootstrap List Group Component</title>
    <meta charset="UTF-8" />
    <meta name="viewport" 
          content="width=device-width, 
                   initial-scale=1
                   shrink-to-fit=no" />
    <link rel="icon" 
          href="img/mdb-favicon.ico" 
          type="image/x-icon" />
    <link rel="stylesheet" 
          href=
    <link rel="stylesheet" 
          href=
    <link rel="stylesheet"
          href="css/mdb.min.css" />
    <script type="text/javascript" 
            src="js/mdb.min.js">
    </script>
</head>
  
<body>
    <div style="margin-left: 50px;">
        <h2 style="margin-top: 50px;">
            neveropen
        </h2>
        <h4>
            MDBootstrap Javascript Cards Component
        </h4>
        <br>
        <div class="card text-center" 
             style="width: 600px">
            <h3 class="card-header">Header</h3>
            <div class="card-body">
                <h5 class="card-title">Card title</h5>
                <p class="card-text">
                    MDBootstrap is a Material Design 
                    and bootstrap-based Javascript UI 
                    library that is used to make good 
                    looking webpages with its seamless 
                    and easy-to-use component.
                </p>
  
                <div class="card-footer">Footer</div>
            </div>
        </div>
    </div>
</body>
</html>


Output:

Javascript MDBootstrap Cards Component

Javascript MDBootstrap Cards Component

Reference: https://mdbootstrap.com/docs/standard/components/cards

Whether you’re preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, neveropen Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we’ve already empowered, and we’re here to do the same for you. Don’t miss out – check it out now!
RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS