How TO - Badges


Learn how to create a badge with CSS.


How To Create a Badge

Badges can be used to add additional information to an element/content:

Example heading New

Example heading New

Example heading New

Example heading New

Try it Yourself »


Step 1) Add HTML:

Example

<span class="badge">New</span>
Step 2) Add CSS:

Example

.badge {
  background-color: red;
  color: white;
  padding: 4px 8px;
  text-align: center;
  border-radius: 5px;
}
Try it Yourself »

Copyright 1999-2023 by Refsnes Data. All Rights Reserved.