.shakeit {
    position: relative;
    animation: shake .2s linear;
    animation-iteration-count: 3;
    border:2px red solid;
}

@keyframes shake {
    0% { left: -5px; }
    100% { right: -5px; }
}