forgottofly forgottofly - 5 months ago 7
CSS Question

Align or break work that is appearing out of the panel/div

Below is the screenshot of my div in which I'm printing the name of the employee.But if the name is too long it exceeds the div.
itried by adding

overflow:auto
which creates a scroll at the bottom of the div that dosen't look good.
Is there any other solution?Image

Answer

Try adding these:

 white-space: nowrap;
 width: <set your width>;
 text-overflow: ellipsis;

To clip your text if it is too long or exceeding the set width. Also adds ... if it exceeds.

Comments