max-width adjusts to fit text?

后端 未结 4 1074
[愿得一人]
[愿得一人] 2020-12-03 16:55

Not the best title, but anyway...

I have an element with a max-width and some text.

If the text is longer than will fit on one line, I get this:

4条回答
  •  -上瘾入骨i
    2020-12-03 17:52

    Use the above solution, but on the inner element set display: table-caption, and DON'T set max-width: 0px. This will include safari support (as well as Firefox 17 and IE8/9 and Chrome)

提交回复
热议问题