Home > Software engineering >  How to use line-clamp with a input field
How to use line-clamp with a input field

Time:08-03

I'm trying to display a text on 4 lines within an input field, but nothing seems to work. Does line-clamp works with input or it's just a p tags thing?

.line-clamp {
     display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    overflow: hidden;
}

CodePudding user response:

Use textarea instead of input and limit the size by rows and cols attribute

<textarea rows="3" ></textarea>
  • Related