Ellipsis Css

Ellipsis Over long text description

by ManiAnand

HTML

<div>
     Check whether ellipsis is working or not using Css 
</div>

CSS

div{
    border: 2px solid grey;
    width: 100px;
    white-space: nowrap;
    text-overflow: ellipsis;
    display: block;
    overflow: hidden;
    padding: 10px;
}

JavaScript

$(document).ready(function() {
    $("div").hover(function() {
        $(this).css('cursor', 'pointer').attr('title', $(this).text());
    }, function() {
        $(this).css('cursor', 'auto');
    });
});