Skip to content Skip to sidebar Skip to footer

Vertically Centering Search Box In Bootstrap

Backgroud:: i am having a really though problem vertically aligning a search box , its kind of a tough nut to crack and i have been at this for a few hours , the HTML markup is cle

Solution 1:

You can't combine position: absolute and display: table and get the results you're expecting. Instead, set a 50% top position and a negative top margin on the search box equal to half its height:

.location-search-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}
.input-group {
    position: absolute;
    top: 50%;
    margin-top: -17px;
}

Demo

Post a Comment for "Vertically Centering Search Box In Bootstrap"