1.

Badges - Bootstrap

Answer»

Bootstrap badges are used for adding additional information.

Example:

<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</head>
<body>

<div class="container mt-3">
<h2>Badges</h2>
<h1>Welcome to InterviewBit<span class="badge bg-secondary">New</span></h1>
</div>

</body>
</html>
Tag NameDescriptionCode
badgeAdd a badge of the same size as the previous parent element. <h1>Heading text <span class="badge badge-secondary">Welcome to InterviewBit</span></h1>
badge-pillBadge-pill is used for making badges more rounded. <span class="badge badge-pill badge-light">Welcome to InterviewBit</span>
badge-primaryBadge-primary is used to add a batch to the primary message. <span class="badge badge-primary">Welcome to InterviewBit</span>
badge-secondaryBadge-secondary is used to add a batch to the secondary message. <span class="badge badge-badge-secondary">Welcome to InterviewBit</span>
badge-successTo display a badge indicating success. <span class="badge bg-success">Welcome to InterviewBit</span>
badge-warningBadge style to indicate a warning. <span <span class="badge bg-success">Welcome to InterviewBit</span>
Badge dangerBadge style to indicate danger. <span class="badge bg-danger">Welcome to InterviewBit</span>
badge-lightBadge style to indicate light background. <span class="badge bg-light text-dark">Welcome to InterviewBit</span>
badge-darkBadge style to indicate dark background. <span c<span class="badge bg-light text-dark">Welcome to InterviewBit</span>



Discussion

No Comment Found