For some reason, when applying a pretty commonly used technique for vertically centering text content within a div, the text moves out of the div in some situations.
Here is a link to an example of the problem: http://www.bootply.com/p4oma9jFjX
Note that Example 1 and 2 work just fine but Example 3 demonstrated the problem.
css
.search-result {
background: grey;
height: 200px;
border-width: 10px;
border-style: solid;
border-color: white;
}
.search-result:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;
}
.item {
display: inline-block;
vertical-align: middle;
}
.ellipsis {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
width: 100px
}
html
<div class="col-sm-6 col-xs-12 text-center search-result">
<div class="item">
<p class="text-32"><b class="">Example 1</b></p>
<p class="small hidden-xs"><b class="">Writer(s)</b><br class="">Garry Bonner, Alan Gordon</p>
<p class="small"><b class="">Made Popular By</b><br class="">The Turtles</p>
</div>
</div>
<div class="col-sm-6 col-xs-12 text-center search-result">
<div class="item">
<p class="text-32"><b class="">Example 2</b></p>
<p class="small"><b class="">Writer(s)</b><br class="">Harold Faltermeyer</p>
<p class="small"><b class="">Made Popular By</b><br class="">Harold Faltermeyer, Beverly Hills Cop (Original Motion Picture Soundtrack), Crazy Frog</p>
</div>
</div>
<div class="col-sm-6 col-xs-12 text-center search-result">
<div class="item">
<p class="text-32 text-center"><b class="">Example 3</b></p>
<p class="small text-center"><b class="">Writer(s)</b><br class="ellipsis">Micayle Mckinney, Rosemarie Tan, Justin Walker, Jonathan James Yip, Jeremy Reeves, Ray Romulus, James Smith, Robin Tadross, Shannon Lawrence</p>
<p class="small text-center"><b class="">Made Popular By</b><br class="">Danity Kane</p>
</div>
</div>