Popover for long text without spaces

前端 未结 2 1636
[愿得一人]
[愿得一人] 2020-12-19 03:51

I have in grid in one column long text which should be truncated in grid (ends with ...) but should show whole in popover.

The popover is displaying correctly when t

相关标签:
2条回答
  • 2020-12-19 04:03

    Since 2012 another solution for word-wrap is:

    overflow-wrap:anywhere;

    More information: Difference between overflow-wrap and word-break?

    Examples of use: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap

    edit: word-break: break-word is officially deprecated; see https://drafts.csswg.org/css-text-3/#valdef-word-break-break-word

    0 讨论(0)
  • 2020-12-19 04:16

    That's because Twitter bootstrap applies a max-width property to the .popover box by default (Which is max-width: 276px;).

    There are two options:

    1) Override the max-width by reseting that to none as:

    .popover {
        max-width: none;
    }
    

    2) Or use word-wrap: break-word; CSS declaration for the popover content box as:

    .popover-content {
        word-wrap: break-word;
    }
    
    0 讨论(0)
提交回复
热议问题