Search code examples
vue.jstext

how to break long text into multiple line in vu


I am showing a line in vue as shown below.

However the text is long to show in one line, wondering how to break one line into multiples lines automatically

<span class="text-xs">Make.Your.Case.With.These.8.Law.Firm.Interview.Questions.and.Answers</span>

enter image description here


Solution

  • As span's width is already limited, you can add word-break: break-all; styles to span, so no matter how long you word is, if it's not fit in the container, it will break into multiple lines, ignoring all of the language rules.