New Tag Transition

by davidpauljunior

HTML

<div>
    <span class="tag-new">
        <span class="text">New</span>
    </span>
</div>

CSS

div {
    position: relative;
    min-height: 30px;
}

.tag-new {
    position: absolute;
    bottom: 0;
    display: inline-block;
    background: blue;
    text-transform: uppercase;
    font-family: sans-serif;
    border-radius: 4px;
    padding: 3px;
    cursor: default;
    min-height: 0;
    min-width: 0;
    transition: min-width 250ms, min-height 250ms, margin 250ms;
}

.tag-new:hover {
    min-height: 13px;
    min-width: 40px;
    border-radius: 4px;
    padding: 3px 8px;
}

.text {
    opacity: 0;
    color: white;
    text-indent: -999em;
    display: block;
    transition: all 250ms ease 0;
    font-size: 0.6em;
}

.tag-new:hover .text {
    opacity: 1;
}