Hover Effect

by Joshua Powell

HTML

<div class="one">
    <span class="two">Cool man</span>
    <span class="three">Cool man</span>
</div>

CSS

.one {
    position: relative;
    height: 50px;
    width: 100px;
    text-align: center;
    line-height: 50px;
    color: white;
    overflow: hidden;
}

.two, .three {
    display: block;
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    -webkit-transition: all 0.5s ease;
}

.two {
    background: brown;
    right: 0;
}

.one:hover .two {
    right: 100%;
}

.three {
    background: orange;
    left: 100%;
}

.one:hover .three {
    left: 0;
}