overflow: hidden behind padding

后端 未结 4 1889
感动是毒
感动是毒 2021-02-14 04:19

Is it possible to define where overflow: hidden begins based on padding?

For example, I currently have a table in which I have a long string. There is padding on the lef

4条回答
  •  孤街浪徒
    2021-02-14 05:00

    The solution like the following example should work:

    div {
        border:1px solid #000;    
        padding:20px;
        width:50px;
        text-overflow: ellipsis;
        white-space: nowrap;
        overflow: hidden;          
    }
    testtesttesttesttesttest

    See on fiddle: https://jsfiddle.net/bm3upfoc/

提交回复
热议问题