<div class="badge red">
  <p class="title">WINNING TEAM</p>
  <p class="subtitle">CTF 365</p>
</div>

<div class="badge green">
  <p class="title">WINNING TEAM</p>
  <p class="subtitle">CTF 365</p>
</div>

<div class="badge gray">
  <p class="title">WINNING TEAM</p>
  <p class="subtitle">CTF 365</p>
</div>

<div class="badge yellow">
  <p class="title">WINNING TEAM</p>
  <p class="subtitle">CTF 365</p>
</div>

<div class="badge blue">
  <p class="title">WINNING TEAM</p>
  <p class="subtitle">CTF 365</p>
</div>
@import "compass/css3";

@import url(https://fonts.googleapis.com/css?family=Montserrat:400,700);
@import url(https://fonts.googleapis.com/css?family=Fjalla+One);

.badge{
  position: relative;
  width: 216px;
  height: 216px;
  display: inline-block;
  margin: 40px;
  background: #2B2B2B;
  border-radius: 8px;
  overflow: hidden;
  .title{
    font-family: "Montserrat", sans-serif;
    font-weight: bold;
    font-size: 1.7em;
    position: absolute;
    top: -28px;
    border-radius: 8px 8px 0 0;
    text-align: center;
    width: 100%;
    padding: 20px 0;
  }
  .subtitle{
    position: absolute;
    font-family: "Fjalla One", sans-serif;
    font-size: 1.8em;
    width: 100%;
    text-align: center;
    color: white;
    position: absolute;
    top: 115px;
    transition: all .3s;
    &:after{
        content: "★";
        display: block;
        font-size: 1.4em;
        position: relative;
        margin: 12px 0 0;
        transition: all .3s;
      }
  }
  &:hover .subtitle:after{
        margin: -5px 0 0;
  }
  &:hover .subtitle{
        top: 100px;
  }
}

@mixin setColor($color){
  .title{
      background: $color;
  }
  .subtitle:after{
      color: white;
  }
  &:hover .subtitle:after{
      color: $color;
  }
}

.red{
  @include setColor(#DC514E);
}

.green{
  @include setColor(#2ecc71);
}

.gray{
  @include setColor(#95a5a6);
}

.yellow{
  @include setColor(#f1c40f);
}

.blue{
  @include setColor(#3498db);
}
View Compiled

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.