I have a long text and I want to hide that part if it is longer than the div.
Set the div with a width or height, (otherwise it won't know whether something is overflowing). Then, add the overflow:hidden;
CSS property-value pair.
If using IE, remember to position the element relative so that IE knows how to deal with it.
I wouldn't use ellipsis, as its not fully cross-browser compatible
Demo is here http://jsfiddle.net/vxN8v/1/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With