I need an overflow to truncate from the left, with ellipses

前端 未结 3 1306
遇见更好的自我
遇见更好的自我 2020-12-10 10:59

Briefly, I have a field where the rightmost digits are most significant. (Naturally, this field comes from our affiliates\' systems, based on their primary keys, so the left

3条回答
  •  一向
    一向 (楼主)
    2020-12-10 11:38

    Try to use this trick:

    HTML

    ert3452654546

    CSS

    .ellipsis {
        overflow: hidden;
        width: 60px;
        direction: rtl; 
        margin-left: 15px;
        white-space: nowrap;
    }
    
    .ellipsis:after {
        position: absolute;
        left: 0px;
        content: "...";
    }​
    

    FIDDLE

提交回复
热议问题