Open In App

What does md stand for in col-md-4 in Bootstrap ?

In Bootstrap, "md" in 'col-md-4' stands for the medium-sized devices breakpoint, targeting screens like tablets and small laptops within the responsive grid system, which comprises extra small ("xs"), small ("sm"), medium ("md"), and large ("lg") breakpoints.

Explanation of col-md-4

Approach

On medium-sized screens, three columns will align horizontally, each occupying one-third of the available width due to the 'col-md-4' class. When viewed on smaller screens, the columns will stack vertically, each spanning the full width of the screen without the medium breakpoint's influence, distributing content accordingly.

Example: The example below shows the col-md-4 class.

<!DOCTYPE html>
<html>

<head>
    <link rel="stylesheet" href=
"https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" />
</head>

<body>
    <div class="container-fluid">
        <div>
            <h2 style="color: green">
              GeeksforGeeks
              </h2>
            <h3>Bootstrap classes</h3>
        </div>
        <div class="container">
            <div class="row">
                <div class="col-md-4">
                    <p>This is column 1</p>
                </div>
                <div class="col-md-4">
                    <p>This is column 2</p>
                </div>
                <div class="col-md-4">
                    <p>This is column 3</p>
                </div>
            </div>
        </div>
    </div>
</body>

</html>

Output:

Animation

Article Tags :