overflow: hidden behind padding

后端 未结 4 1899
感动是毒
感动是毒 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:11

    table {
      width: 300px;
      table-layout: fixed;
    }
    td {
      border: 1px solid red;
      padding: 10px;
      overflow: hidden;
    }
    td span {
      float: right;
    }
    .inner {
      border: 1px solid blue;
      overflow: hidden;
    }
    something 1234567890ABCDEFG something

    Wrap the table content to span
    a Very Long line of text and hope this helps

    then add the CSS TD SPAN, float it to right
    TD SPAN{ float:right }

提交回复
热议问题