How to Create a Checkmark / Tick with CSS


We can create a customized checkmark using CSS. The following examples illustrate this effect −

Example

 Live Demo

<!DOCTYPE html>
<html>
<style>
div {
   margin: 2%;
   position: relative;
   width: 40px;
   height: 40px;
   box-shadow: inset 0 0 12px lightblue;
}
div::before {
   content: "";
   position: absolute;
   width: 8px;
   top: 50%;
   height: 50%;
   border-radius: 2px;
   background-color: rgb(123,45,20);
   transform: translateX(12px) rotate(-45deg);
   transform-origin: left bottom;
   z-index: +1;
}
div::after {
   content: "";
   position: absolute;
   bottom: 0;
   height: 8px;
   width: 100%;
   border-radius: 2px;
   background-color: rgb(200,52,120);
   transform: translateX(12px) rotate(-45deg);
   transform-origin: left bottom;
}
</style>
<body>
Custom mark!
<div></div>
</body>
</html>

Output

This will produce the following result −

Example

 Live Demo

<!DOCTYPE html>
<html>
<style>
body {
   padding: 2%;
   text-align: center;
}
div {
   display: inline-block;
   height: 100px;
   width: 35px;
   border-bottom: 10px solid chartreuse;
   border-right: 10px solid chartreuse;
   transform: rotate(45deg);
}
</style>
<body>
<div></div>
</body>
</html>

Output

This will produce the following result −

Updated on: 12-Mar-2021

3K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements