How to Create: Block Counter

Learn how to use CSS to create a "block counter".

Block counters

Block counters tell people how their business is doing by displaying interesting numbers:

11+

Partners

55+

Projects

100+

Happy Clients

100+

Meetings

Try it yourself

How to Create Block Counter

First step - Add HTML:

<div class="row">
  <div class="column">
    <div class="card">
      <p><i class="fa fa-user"></i></p>
      <h5>11+</h5>
      <p>Partners</p>
    </div>
  </div>
  <div class="column">
    <div class="card">
      <p><i class="fa fa-check"></i></p>
      <h5>55+</h5>
      <p>Projects</p>
    </div>
  </div>
  <div class="column">
    <div class="card">
      <p><i class="fa fa-smile-o"></i></p>
      <h5>100+</h5>
      <p>Happy Clients</p>
    </div>
  </div>
  <div class="column">
    <div class="card">
      <p><i class="fa fa-coffee"></i></p>
      <h5>100+</h5>
      <p>Meetings</p>
    </div>
  </div>
</div>

Second step - Add CSS:

* {
  box-sizing: border-box;
}
/* Float four columns side by side */
.column {
  float: left;
  width: 25%;
  padding: 0 5px;
}
.row {margin: 0 -5px;}
/* Clear the float after the columns */
.row:after {
  content: "";
  display: table;
  clear: both;
}
/* Responsive column */
@media screen and (max-width: 600px) {
  .column {
    width: 100%;
    display: block;
    margin-bottom: 10px;
  }
}
/* Set the style for the counter card */
.card {
  box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
  padding: 16px;
  text-align: center;
  background-color: #444;
  color: white;
}
.fa {font-size:50px;}

Try it yourself