Cause line to wrap to new line after 100 characters

前端 未结 7 1591
慢半拍i
慢半拍i 2020-12-14 08:23

Is there a way in CSS that I can cause the 3rd element in this list, which is longer than the rest, to wrap to a new line if it extends over 100 characters? so that the rest

7条回答
  •  时光取名叫无心
    2020-12-14 08:24

    That worked pretty well for me :

    Using a tag where you want the line to wrap, and then prevent white spaces from wrapping.

    .h2_wrap
    {
       white-space: nowrap;
      font-size: 18px;
    }

    Pretty long sentence that looks better when cut at one specific spot

提交回复
热议问题