0

I have tried using text-overflow: ellipsis; this syntax but it's not working can any one help me

Html

   <div class="product-desc">
         <p>How to show dots if text is exceeds than the limit</p>
    </div>

Style that i have used

.product-desc{
    padding: 0.8em 1.5em;
    background: #337AB7;
    text-align: center;
     text-overflow: ellipsis;
}
.product-desc p{
    font-size: 1.2em;
    color: #fff;
    margin-bottom: 0.5em;
    font-family: 'Carrois Gothic', sans-serif;
}
Learner
  • 121
  • 12

1 Answers1

1

Try the below:

.product-desc p{
    font-size: 1.2em;
    color: #fff;
    margin-bottom: 0.5em;
    font-family: 'Carrois Gothic', sans-serif;
    width:180px;
    white-space: nowrap;
    overflow:hidden !important;
    text-overflow: ellipsis;
}
lalithkumar
  • 3,480
  • 4
  • 24
  • 40