Show Output
<!DOCTYPE htpl> <htpl lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <title>Bootstrap 4 Width Classes</title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"> <script src="https://code.jquery.com/jquery-3.5.1.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.1/dist/umd/popper.min.js"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script> <style> .bs-example{ margin: 20px; } .bs-example div{ background: #dbdfe5; margin: 10px; } .bs-example div:nth-child(2n){ background: #abb1b8; } </style> </head> <body> <div class="bs-example"> <div class="w-25 p-3">Width 25%</div> <div class="w-50 p-3">Width 50%</div> <div class="w-75 p-3">Width 75%</div> <div class="w-100 p-3">Width 100%</div> <div class="w-auto p-3">Width auto</div> </div> </body>