style.css
.product-information p { color: #696763; font-family: 'Roboto', sans-serif; margin-bottom: 5px; overflow: hidden; } index.html
<div class="product-image-wrapper"> <div class="single-products"> <div class="productinfo text-center"> <?= Html::img($mainImg->getUrl('207x183'), ['alt' => $hit->name])?> <h2>$<?= $hit->price?></h2> <p><a href="<?= \yii\helpers\Url::to(['product/view', 'id' => '7']) ?>"><?= $hit->name?></a></p> <a href="<?= \yii\helpers\Url::to(['cart/add', 'id' => $hit->id])?>" data-id="<?= $hit->id?>" class="btn btn-default add-to-cart"><i class="fa fa-shopping-cart"></i>Add to cart</a> </div> </div> if through "overflow: hidden;", then it does not work