.item { float: left; width: 40px; height: 40px; cursor: pointer; white-space: nowrap; /* this is required unless you put the helper span closely near the img */ text-align: center; margin: 0; } .item .helper { display: inline-block; height: 100%; vertical-align: middle; } .item img { margin: 0 auto; vertical-align: middle; padding: 3px; } .item img:hover { border: 1px solid #40a9ff; }