Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

checkmark/tick inside a circle (icon) using pure css3

Tags:

css

I'm trying to draw a circle with tick/checkmark inside it using pure css3

.success-checkmark {
    content: '✔';
    position: absolute;
    left:0; top: 2px;
    width: 17px; height: 17px;
    border: 1px solid #aaa;
    background: #f8f8f8;
    border-radius: 50%;
    box-shadow: inset 0 1px 3px rgba(0,0,0,.3)

}

How can i achieve i have tried with the above code?

like image 592
HK123 Avatar asked Dec 22 '22 23:12

HK123


1 Answers

You can use content: '✔'; only on pseudo elements, so try using the following selector:

    .success-checkmark:after {
      content: '✔';
      position: absolute;
      left:0; top: 2px;
      width: 20px; 
      height: 20px;
      text-align: center;
      border: 1px solid #aaa;
      background: #f8f8f8;
      border-radius: 50%;
      box-shadow: inset 0 1px 3px rgba(0,0,0,.3)
    }
<div class="success-checkmark"></div>
like image 65
cloned Avatar answered Jan 05 '23 18:01

cloned