CSS: Vertically Center an Element

Published on Author craigzearfossLeave a comment
/* Vertically center an element */
.element {
    top: 50%;
    -webkit-transform: translateY(-50%);
    -ms-transform: translateY(-50%);
    transform: translateY(-50%);
}

Leave a Reply

Your email address will not be published. Required fields are marked *