none
Ellipsis on multiline text not working in IE, Edge and Firefox RRS feed

  • Question

  • Hi i'm currently working on ASP.NET MVC application. I have been working on responsiveness of the page. I want to make the long text cut by displaying ellipsis(...) on the last text when the screen is resized. I've tried using -Webkit-line-clamp property, but it is not working in IE, Edge and Firefox. Is there any other way to make this ellipsis work in multiple line? See below for my codes.

     <div class="row description">
                 <p class="description">The Hitch Hiker's Guide to the Galaxy has a few things to say on the subject of towels. 
    A towel, it says, is about the most massively useful thing an interstellar hitch hiker can have. Partly it has great practical value - you can wrap it around you for warmth as you bound across the cold moons of  Jaglan Beta; you can lie on it on the brilliant marble-sanded beaches of Santraginus V, inhaling the heady sea vapours; you can sleep under it beneath the stars which shine so redly on the desert world of Kakrafoon;  use it to sail a mini raft down the slow heavy river Moth; wet it for use in hand-to-hand-combat; wrap it round your head to ward off noxious fumes or to avoid the gaze of the Ravenous Bugblatter Beast of Traal (a mindboggingly stupid animal, it assumes that if you can't see it, it can't see you - daft as a bush, but very ravenous); you can wave your towel in emergencies as a distress signal, and of course dry yourself off with it if it still seems to be clean enough. More importantly, a towel has immense psychological value.</p>
     </div>

    CSS: 

    .description {
        display: block;
        display: -webkit-box;
        max-width: 100%;
        height: 39.2px;
        margin: 0 auto;
        font-size: 14px;
        line-height: 1.4;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-overflow: ellipsis;
        padding: 0px;
        -o-text-overflow: ellipsis;
    }

    • Moved by CoolDadTx Monday, March 20, 2017 6:50 PM ASP.NET related
    Monday, March 20, 2017 3:20 AM

All replies