html (+css): denoting a preferred place for a line break

前端 未结 9 1621
南旧
南旧 2020-11-28 03:08

Let\'s say I have this text that I want to display in an HTML table cell:

Honey Nut Cheerios, Wheat Chex, Grape-Nuts, Rice Krispies, Some random cereal with          


        
9条回答
  •  無奈伤痛
    2020-11-28 03:49

    By using

    span.avoidwrap { display:inline-block; }
    

    and wrapping the text I want to be kept together in

     Text 
    

    it will wrap first in preferred blocks and then in smaller fragments as needed.

提交回复
热议问题